How do you check if a String contains a special character like:
[,],{,},{,),*,|,:,>,
Pattern p = Pattern.compile("[^a-z0-9 ]", Pattern.CASE_INSENSITIVE); Matcher m = p.matcher("I am a string"); boolean b = m.find(); if (b) System.out.println("There is a special character in my string");
1.4m articles
1.4m replys
5 comments
56.9k users