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");
More Related Contents:
- foo(int) is not applicable for the arguments (String)
- How can I pad a String in Java?
- Comparing strings with == which are declared final in Java
- How can I check if a single character appears in a string?
- In Java, how do I check if a string contains a substring (ignoring case)? [duplicate]
- Android Split string
- How do I convert CamelCase into human-readable names in Java?
- Count words in a string method?
- Check and extract a number from a String in Java
- When are Java Strings interned?
- Why are strings immutable in many programming languages? [duplicate]
- String parsing in Java with delimiter tab “\t” using split
- Scanner only reads first word instead of line
- Create a string with n characters
- Convert String XML fragment to Document Node in Java
- Best way to concatenate List of String objects? [duplicate]
- Convert JsonObject to String
- Convert a string to a GregorianCalendar
- How to remove only trailing spaces of a string in Java and keep leading spaces?
- String gets assigned to a List without a compilation error [duplicate]
- Why is String.length() a method?
- Is it possible to change the text color in a string to multiple colors in Java?
- Java compressing Strings
- Java String ReplaceAll method giving illegal repetition error?
- Unable to print russian characters
- Translating strings character by character
- What is the most efficient way to convert an int to a String?
- String.replaceAll is considerably slower than doing the job yourself
- Remove all occurrences of \ from string
- Java: Checking equality of arrays (order doesn’t matter)