Answers for "how to check the string have any special character or not in java"

0

how to find a special character in a string in java

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");
Posted by: Guest on August-06-2021

Code answers related to "how to check the string have any special character or not in java"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language