theshoeshiner opened a new pull request, #450:
URL: https://github.com/apache/commons-text/pull/450

   This is a more formal API for parsing and formatting strings of various 
"Cases". 
   
   Similar logic is present in `org.apache.commons.text.CaseUtils` as well as 
#360 to add two additional case functions, but that code is based around the 
initial string having delimiters, and cannot translate between cases. This API 
aims to be slightly more formal, expecting the inputs to the parse method to 
abide by the syntax of the case. No assumptions (other than the Case syntax) 
are made about the inputs, and removal of unwanted characters is left to the 
user. Case classes can be sub classed as necessary to support that.
   
   The Case interface exposes two methods...
   ```
   String format(Iterable<String> tokens)
   List<String> parse(String string)
   ```
   with parse() returning a List of String tokens, which can then be passed to 
another Case instance format() method. Allowing users to change the case of a 
string e.g. 
`CamelCase.INSTANCE.format(KebabCase.INSTANCE.parse("my-kebab-string"))`. I 
followed the pattern of other commons-text classes in using code points rather 
than primitive chars (I assume to support UTF32).
   
   


-- 
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]

Reply via email to