Polishing
This commit is contained in:
@@ -518,22 +518,20 @@ public abstract class StringUtils {
|
||||
if (!hasLength(str)) {
|
||||
return str;
|
||||
}
|
||||
else {
|
||||
char baseChar = str.charAt(0);
|
||||
char updatedChar;
|
||||
if (capitalize) {
|
||||
updatedChar = Character.toUpperCase(baseChar);
|
||||
}
|
||||
else {
|
||||
updatedChar = Character.toLowerCase(baseChar);
|
||||
}
|
||||
if (baseChar == updatedChar) {
|
||||
return str;
|
||||
}
|
||||
char[] chars = str.toCharArray();
|
||||
chars[0] = updatedChar;
|
||||
return new String(chars, 0, chars.length);
|
||||
char baseChar = str.charAt(0);
|
||||
char updatedChar;
|
||||
if (capitalize) {
|
||||
updatedChar = Character.toUpperCase(baseChar);
|
||||
}
|
||||
else {
|
||||
updatedChar = Character.toLowerCase(baseChar);
|
||||
}
|
||||
if (baseChar == updatedChar) {
|
||||
return str;
|
||||
}
|
||||
char[] chars = str.toCharArray();
|
||||
chars[0] = updatedChar;
|
||||
return new String(chars, 0, chars.length);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user