According to https://en.wikipedia.org/wiki/Capitalization

to "capitalize" is writing a word with its first letter as a capital letter 
(upper-case letter) 
AND THE REMAINING LETTERS IN LOWER CASE writing systems.

So 

  'SOMETHING' capitalized

currently returns "SOMETHING" in Pharo but should return "Something" according 
to the definition to end up with lowercase.
If we fix this I guess we would also align Pharo with other languages, like C# 
for example [1]. 

Could be easily changed by replacing "copy" with "asLowercase" in #capitalized:

 capitalized
        "Return a copy with the first letter capitalized"
        | cap |
        self isEmpty ifTrue: [ ^self copy ].
        cap := self asLowercase.
        cap at: 1 put: (cap at: 1) asUppercase.
        ^ cap

Should we fix this? Do not know about any side effects...


Note: a) Squeak has the same issue
      b) it fits for #uncapitalized, see [2]
      c) Dont know about ANSI standard or any other ST dialect

Thx
T.


[1] 
https://github.com/srkirkland/Inflector/blob/master/Inflector.Tests/CapitalizeTests.cs
[2] 
https://github.com/srkirkland/Inflector/blob/master/Inflector.Tests/UncapitalizeTests.cs

Reply via email to