-
Notifications
You must be signed in to change notification settings - Fork 7k
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
startCase removes ampersand, all symbols #3383
Comments
Hi @benterprise!
Not for our casing methods. They break a string into words and then apply transformations on them. |
Odd that this method is destructive in terms that it removes characters. I would have expected it to title case what it can and leave everything else. |
@benterprise this is workaround.
result:- "Jhon&John C/O Dr. Blah" This is a late response but just mentioned if anyone who come across such issue can get the solution. |
This is weird. If function's name is I see, this behaviour is shown in examples in docs, but still not clear. It should be clearly mentioned in docs, that it removes any spec symbols. The best would be to have some option to disable removing spec symbols. Thanks. |
I have to agree with the comments. Had to use the workaround mentioned by mukesh. I can imagine the usefulness of removing all the spec symbols, but I'd say split that into a separate function. |
This caused a mess in our search engine...we really were not expecting this to be a destructive operation. |
Completely agree. A function called |
@benterprise's workaround didn't work for me because it capitalized the first letter after a diacritical mark: pōmaikaʻi becomes "PōMaikaʻI", which is not the desired result. You could exclude all of the possible diacritical letter variations, and that would (in theory) work, but it seems that it would be better if startCase just did not strip punctuation. Agree that should be a different function. Please update! |
And yet as of late 2019, it still not working as expected... for once I started to try this tool a little more deeper and it isn't working |
Hi folks! In v5 we will revisit this. |
_.startCase("one & two") returns "One Two", ideally it'd return "One & Two". Is there a workaround?
The text was updated successfully, but these errors were encountered: