Skip to content
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

camelcase("variable[subscript]") produces "variablubscript]" #15

Open
mobiware opened this issue Sep 4, 2019 · 3 comments
Open

camelcase("variable[subscript]") produces "variablubscript]" #15

mobiware opened this issue Sep 4, 2019 · 3 comments

Comments

@mobiware
Copy link

mobiware commented Sep 4, 2019

import stringcase
stringcase.camelcase("variable[subscript]")

produces "variablubscript]" whereas one would expect it to leave the input string unmodified and return "variable[subscript]"

@danields761
Copy link

danields761 commented Oct 2, 2019

Few examples with dash symbol as well:

In [1]: import stringcase

In [2]: stringcase.camelcase('foo-bar')
Out[2]: 'foar'

In [3]: stringcase.camelcase('foo-bar-baz')
Out[3]: 'foaaz'

@HijiBijiHijiBiji
Copy link

And with space as well:

>>> import stringcase
>>> stringcase.camelcase('Sample Text')
'samplext'

@ammurdoch
Copy link

Here's a possible workaround:

stringcase.camelcase(stringcase.titlecase(k).replace(' ', ''))

Not ideal, but it seems to work.

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

No branches or pull requests

4 participants