Class Case
java.lang.Object
ch.tocco.nice2.toolbox.api.string.Case
Static utility methods for dealing with upper/lower casing in Java when it comes to
comparing Strings for equality. This is for "logical" casing, not i18n.
Reading: http://cafe.elharo.com/blogroll/turkish/
The reason for using a separate class instead of hacking in the commands everywhere is to implicitly document the intention of doing a logical case conversion or comparision, not an i18n one.
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleancontainsIgnoreCase(Iterable<String> haystack, String needle) Tells if the iterable contains the string when ignoring case.static booleanequalsIgnoreCase(@Nullable String one, @Nullable String two) Same as Java's implementation, but does not use the default Locale.static StringExecutes String.toLowerCase(Locale.ENGLISH).static StringExecutes String.toUpperCase(Locale.ENGLISH).
-
Method Details
-
uc
-
lc
-
equalsIgnoreCase
-
containsIgnoreCase
Tells if the iterable contains the string when ignoring case.- Parameters:
haystack- Usually a Collection. May be empty, may containnullvalues.needle- In any case, will be compared usingequalsIgnoreCase(String, String).- Returns:
trueif it is in there.
-