You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "dilip-4 (via GitHub)" <gi...@apache.org> on 2025/05/23 07:51:36 UTC
[PR] Add camelCase utility method for converting strings to camelCase format [commons-lang]
dilip-4 opened a new pull request, #1389:
URL: https://github.com/apache/commons-lang/pull/1389
### Summary
This PR adds a `camelCase(String input)` method to a new utility class (`StringUtils`) that transforms strings into camelCase format. It handles various common delimiters (`_`, `-`, whitespace) and removes non-alphanumeric characters.
### Example Inputs and Outputs
- "user_name" → "userName"
- "User-Name" → "userName"
- "user name test" → "userNameTest"
- "USER_ID" → "userId"
### Motivation
This utility fills a gap in string transformation capabilities in `commons-lang`, especially for developers working with naming conventions for APIs, variables, or JSON keys.
### Notes
- Added comprehensive Javadoc and test cases.
- Followed existing code style and conventions.
Let me know if any changes or improvements are needed. Happy to iterate!
--
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
Re: [PR] Add camelCase utility method for converting strings to camelCase format [commons-lang]
Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory commented on PR #1389:
URL: https://github.com/apache/commons-lang/pull/1389#issuecomment-2903952351
-1: These types of additions are best suited for Commons Text, which already has this kind of code in 'CaseUtils'.
--
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
Re: [PR] Add camelCase utility method for converting strings to camelCase format [commons-lang]
Posted by "dilip-4 (via GitHub)" <gi...@apache.org>.
dilip-4 closed pull request #1389: Add camelCase utility method for converting strings to camelCase format
URL: https://github.com/apache/commons-lang/pull/1389
--
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
Re: [PR] Add camelCase utility method for converting strings to camelCase format [commons-lang]
Posted by "dilip-4 (via GitHub)" <gi...@apache.org>.
dilip-4 commented on PR #1389:
URL: https://github.com/apache/commons-lang/pull/1389#issuecomment-2904014378
ok will check.
--
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
Re: [PR] Add camelCase utility method for converting strings to camelCase format [commons-lang]
Posted by "dilip-4 (via GitHub)" <gi...@apache.org>.
dilip-4 commented on PR #1389:
URL: https://github.com/apache/commons-lang/pull/1389#issuecomment-2903991549
Thank you for the feedback! I wasn't aware that `CaseUtils` already included toCamelCase. I’ll take a look there.
While reviewing the existing methods, I’d like to check:
Are there existing methods for converting to other common formats like:
1. toSnakeCase
3. toKebabCase
5. toPascalCase
If these are not present in Commons Text, I’d be happy to contribute them there instead.
Please let me know if this would be a useful addition or if there's an existing alternative I should refer to.
--
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
Re: [PR] Add camelCase utility method for converting strings to camelCase format [commons-lang]
Posted by "garydgregory (via GitHub)" <gi...@apache.org>.
garydgregory commented on PR #1389:
URL: https://github.com/apache/commons-lang/pull/1389#issuecomment-2904007062
@dilip-4
Yes: Just look at the repository and its PRs.
--
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