We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Camelize()
I have an issue using Camelize() method. It works not exactly as I expected.
The next code
"IOModule".Camelize()
will return
"iOModule"
while I'm expecting
"ioModule"
I think it's a bug, we do need respect acronyms on camelizing strings.
I took the original code of Camelize() method and reworked it a bit:
public static string CamelizeRespectingAcronyms(this string input) { var pascalized = input.Pascalize(); if (pascalized.Length == 0) { return pascalized; } var firstUpperSymbolsCount = pascalized.TakeWhile(char.IsUpper).Count(); if (firstUpperSymbolsCount > 2) { var acronymLength = firstUpperSymbolsCount - 1; return pascalized[..acronymLength].ToLower() + pascalized[acronymLength..]; } return pascalized[..1].ToLower() + pascalized[1..]; }
The update method is returning
for
"IOModule".Capitilize()
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Issue
I have an issue using
Camelize()
method. It works not exactly as I expected.Example
The next code
will return
"iOModule"
while I'm expecting
"ioModule"
I think it's a bug, we do need respect acronyms on camelizing strings.
Proposed solution
I took the original code of
Camelize()
method and reworked it a bit:The update method is returning
"ioModule"
for
The text was updated successfully, but these errors were encountered: