8000 Added whitespace · Issue #5977 · lodash/lodash · GitHub
[go: up one dir, main page]

Skip to content

Added whitespace #5977

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

Open
OsamaBodiaf opened this issue Mar 30, 2025 · 2 comments
Open

Added whitespace #5977

OsamaBodiaf opened this issue Mar 30, 2025 · 2 comments

Comments

@OsamaBodiaf
Copy link

Something like startCase("3d") seems to return 3 D instead of 3D

@Rkverma94
Copy link

Fixing this issue, that If there is a number followed by a letter then whitespace should be removed.
As given in example by @OsamaBodiaf

@SizanRana
Copy link

Thanks for reporting this! 🙌
I looked into the behavior of _.startCase('3d'), and from what I can see, the function is working as designed.

Lodash splits strings into words based on character transitions — including from digits to letters — so '3d' is split into ['3', 'd'], which then becomes '3 D' after capitalization and spacing.

If the goal is to preserve '3d' as a single word (e.g., for abbreviations), that would likely require changes to the words() utility, which could impact other use cases.

Just wanted to share this in case it helps clarify the current behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants
0