using String.matches("\\S") does not work with more than one character
800348Aug 15 2008 — edited Aug 15 2008This is a rather simple question,
Why is it that doing
System.out.print("b".matches("\\S")); produces true
and
System.out.print("ba".matches("\\S")); produces false?
using \S should return true if there are any non whitespace characters in the string but why is the result affected by how many characters are in the string?
I just want to check if a string (of any length) contains non whitespace characters.
Thanks