Add StringUtils.containsWhitespace(String str)
----------------------------------------------
Key: LANG-625
URL: https://issues.apache.org/jira/browse/LANG-625
Project: Commons Lang
Issue Type: New Feature
Affects Versions: 2.5
Reporter: Julien HENRY
Please add the new method StringUtils.containsWhitespace(String str). Here is
the version in the Spring framework:
/**
* Check whether the given CharSequence contains any whitespace
characters.
* @param str the CharSequence to check (may be <code>null</code>)
* @return <code>true</code> if the CharSequence is not empty and
* contains at least 1 whitespace character
* @see java.lang.Character#isWhitespace
*/
public static boolean containsWhitespace(CharSequence str) {
if (!hasLength(str)) {
return false;
}
int strLen = str.length();
for (int i = 0; i < strLen; i++) {
if (Character.isWhitespace(str.charAt(i))) {
return true;
}
}
return false;
}
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.