[
https://issues.apache.org/jira/browse/LANG-1043?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14165341#comment-14165341
]
James Sawle commented on LANG-1043:
-----------------------------------
The isAlpha method is the character equivalent to isNumeric.
I believe two new methods that check if any alphabetic characters are
upper/lowercase should be generated, and the current isAllUpperCase and
isAllLowerCase should call the new methods along with the isAlpha method. This
would lead to a more generic API with multiple predicates that could be used in
various combinations as required, as is my understanding of the library.
public boolean isUpperCase(String) //Checks if alphabetic characters are
uppercase
public boolean isLowerCase(String) //Checks if alphabetic characters are
lowercase
public boolean isAllUpperCase(String) //Checks that all characters are
alphabetic and uppercase
public boolean isAllLowerCase(String) //Checks that all characters are
alphabetic and lowercase
I will throw together a proposed patch for this over the evening.
> isAllUpperCase should only check Alpha characters
> -------------------------------------------------
>
> Key: LANG-1043
> URL: https://issues.apache.org/jira/browse/LANG-1043
> Project: Commons Lang
> Issue Type: Improvement
> Components: lang.*
> Affects Versions: 3.3.2
> Reporter: Frédéric JECKER
> Fix For: Discussion
>
> Attachments: LANG-1043.patch
>
>
> Currently, isAllUpperCase checks character by character if the current
> character is UpperCase or not using Character.isUpperCase().
> The problem is that characters like spaces aren't considered as uppercase
> characters.
> IMHO, isAllUpperCase should only check the state of alpha characters so that :
> - StringUtils.isAllUpperCase("ABC DEF GHI") = true (false currently)
> - StringUtils.isAllUpperCase("ABC / DEF") = true (false currently)
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)