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

'string capitalizeAll' doesn't work for numbers #124

Closed
doublec opened this issue Sep 4, 2017 · 4 comments
Closed

'string capitalizeAll' doesn't work for numbers #124

doublec opened this issue Sep 4, 2017 · 4 comments

Comments

@doublec
Copy link
Collaborator

doublec commented Sep 4, 2017

If I try to capitalize a string with numbers, the numbers are changed to unprintable characters:

'abcd1234defg' capitalizeAll
'ABCD????DEFG'

Tested with github master branch.

@russellallen
Copy link
Owner

Lol. Well the simplest fix is to change:

capitalizeAll = (copyMutable mapBy: [|:c| c isCapitalized ifTrue: c False: [(c asByte + capitalizationDifference) asCharacter]])

to

copyMutable mapBy: [|:c| (c isLetter not || c isCapitalized) ifTrue: c False: [(c asByte + capitalizationDifference) asCharacter]]

unless you have a better idea...

@davidungar
Copy link
Collaborator

davidungar commented Sep 6, 2017 via email

@doublec
Copy link
Collaborator Author

doublec commented Sep 7, 2017

Looks good to me!

@russellallen
Copy link
Owner

Fixed - Commit 93b24da on dev branch

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

3 participants