You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by GitBox <gi...@apache.org> on 2022/09/26 22:08:10 UTC

[GitHub] [commons-text] angusdev commented on a diff in pull request #360: TEXT-217 - Add CaseUtils.toSnakeCase and CaseUtils.toKebabCase

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: issues-unsubscribe@commons.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org