angusdev commented on code in PR #360:
URL: https://github.com/apache/commons-text/pull/360#discussion_r980542958
##########
src/main/java/org/apache/commons/text/CaseUtils.java:
##########
@@ -96,11 +96,100 @@ public static String toCamelCase(String str, final boolean
capitalizeFirstLetter
return new String(newCodePoints, 0, outOffset);
}
+ private static String toDelimiterCase(String str, final char newDelimiter,
final char... delimiters) {
+ if (StringUtils.isEmpty(str)) {
+ return str;
+ }
+ str = str.toLowerCase();
+ final int strLen = str.length();
+ final int[] newCodePoints = new int[strLen];
Review Comment:
I'm no expert in Unicode, please see my understanding is correct or not:
Change to `final int[] newCodePoints = new int[str.codePointCount(0,
strLen)];`. But since code points <= number of chars, there will be no test
case to validate this change. Also will change `toCamelCase()` as well.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]