On 03/15/2017 05:33 AM, Torsten Bergmann wrote:
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].
That wouldn't be what I would expect. Here's what dictionary.com has for
capitalize:
1. to write or print in capital letters letters or
with an initial capital letter
That definition doesn't say what happens with the rest of the letters.
As for C#, isn't that someone's extension method for String and not a
Microsoft method? I don't see that method on Microsoft's current String
class documentation:
https://msdn.microsoft.com/en-us/library/system.string(v=vs.110).aspx
Also, the Uncapitalize method is inconsistent with the Capitalize
method. The Uncapitalize method changes only the first character and all
other characters are unchanged. However, the Capitalize method can
change all characters.
Finally, Dolphin Smalltalk has an implementation that is similar to Pharo's:
https://github.com/dolphinsmalltalk/Dolphin/blob/master/Core/Object%20Arts/Dolphin/Base/String.cls
John Brant