My program is meant to return a reversed version of whatever string the user inputs, but it should also report bad input if the string contains any symbols. I cannot seem to find a way to do this. By the way the program comes with an IO.java module. Here is my code
public class ReverseWords{
public static void main(String [ ] args){
String word= IO.readString();
if(word.contains("[\\!\\*\\@\\#\\-\\+\\.\\^\\:\\.\\]")){
IO.reportBadInput();}
word = new StringBuffer(word).reverse().toString();
IO.outputStringAnswer(word);
}
}