mirror of
https://github.com/shekhargulati/strman-java.git
synced 2026-10-19 22:13:52 +00:00
Resolved #51. Incorporated suggestions of johnsdouglass
This commit is contained in:
@@ -528,7 +528,12 @@ public abstract class Strman {
|
||||
*/
|
||||
public static boolean isUpperCase(final String value) {
|
||||
validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER);
|
||||
return Objects.equals(value, value.toUpperCase());
|
||||
for (int i = 0; i < value.length(); i++) {
|
||||
if (Character.isLowerCase(value.charAt(i))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -539,7 +544,12 @@ public abstract class Strman {
|
||||
*/
|
||||
public static boolean isLowerCase(final String value) {
|
||||
validate(value, NULL_STRING_PREDICATE, NULL_STRING_MSG_SUPPLIER);
|
||||
return Objects.equals(value, value.toLowerCase());
|
||||
for (int i = 0; i < value.length(); i++) {
|
||||
if (Character.isUpperCase(value.charAt(i))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user