I need to check whether a string contains white spaces commas and more than one @ signs. I used the following method to do so, but it didn’t work properly for me.
boolean flag = string.matches("\\s,@");
Can anyone of you tell me what has gone wrong in it?
Try this