New issue
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
capitalize() works as unexpected #137
Comments
This seems to be the expected behavior. Both python and ruby return 'thisPost'.capitalize()
"Thispost" |
@MurWade notice the order of your two snippets... in the first you're doing But the question remains, should we be lower casing the rest of the string or leave it alone? |
@jprichardson exactly. i think it would make sense to leave the rest of the chars the way it is. |
I don't think it makes sense to leave the rest alone since most languages define |
@az7arul I'm good with that. Since that's the current behavior and Ruby/Python seem to follow that behavior, let's leave it as is then. @MurWade Closing. If I missed something in my understanding, let me know. |
S('this post').capitalize().camelize().s; // returns ThisPost
But
S('this post').camelize().capitalize().s; // returns Thispost
capitalize() IMO should only change the first character and not worry about the rest.
The text was updated successfully, but these errors were encountered: