[ 
https://issues.apache.org/jira/browse/LANG-409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12568233#action_12568233
 ] 

Jörg Gottschling commented on LANG-409:
---------------------------------------

Yes, but mainly with validation of user inputs, I think. I remember just one 
other case, where a String had to be at least three 'real' characters long. All 
other cases where more complex, like 40 hex chars or something like that.

> StringUtils.isText to check in a null safe way if a String has (real) text
> --------------------------------------------------------------------------
>
>                 Key: LANG-409
>                 URL: https://issues.apache.org/jira/browse/LANG-409
>             Project: Commons Lang
>          Issue Type: Improvement
>            Reporter: Jörg Gottschling
>            Priority: Minor
>
> I used something similar from the Spring Framework and it was useful. I 
> suggest two methods where the second is a little more advanced then theirs.
> First a method StringUtils.isText(String text) : boolean which checks if the 
> String is not null and contains a least one not whitespace character. (In 
> Spring it's "hasText", but "isText" seams to be more consistent within 
> commons lang.)
> The second method could be StringUtils.isText(String text, int n) : boolean 
> which checks if the String is not null and contains a least n not whitespace 
> characters.
> Question: What happens if a (stupid ;-) developer checks for -5 characters? I 
> think it should throw an IllegalArgumentException.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to