I’m trying to remove some words from the line. I don’t want to prescribe them but replace them, because the words that I remove may increase. So I used an array. But when I try to do this, I get errors. I will be glad of any help. Answer This is a partial answer.. Problem #1: The Arrays.toString(a) returns a
Tag: patternsyntaxexception
how pattern syntax exception works
how do I use the following statement in try n catch block to chk if the name is valid and display error msg if any? and how to use PatternSyntaxException Answer You don’t need a try…catch to check if the name is valid. The line you wrote: NAME_PATTERN.matcher(name).matches() returns a boolean, true if it matches and false if it doesn’t.