what to use instead of the deprecated `String.capi...
# stdlib
p
what to use instead of the deprecated
String.capitalize()
function?
e
Copy code
replaceFirstChar(Char::titlecase)
works
p
but that’s so much worse
2
nope 1
s
I think it’s probably a naming problem, right?
capitalize
could mean titlecase-ing an entire string or just the start of a string, or maybe it could be interpreted as a
String.toUpper()
kind of function. Searching stackoverflow for “capitalize” gets back a few results with people looking for different behaviors but calling it the same thing
c
hmm right. even
"blah blah".titleCase()
would be “Blah Blah”. so the new method definately is more consistent.
e
capitalize
means clearly only the first letter, I honestly don't see any potential interpreting issues
🚫 2
p
capitalize could mean titlecase-ing an entire string
no it couldn’t, it means converting the first letter to uppercase; the original name was perfect
e
To upper case or to title case? What’s the only thing it could mean? What if the first letter is already uppercased, but not in a title case?
e
@todd.ginsberg At 35 years old I never, and I underline never, had a single misunderstanding about using the world capitalize in different languages/countries and with all the people I have interacted with so far.. On a side note, I do find kind of amusing all this technicality around title/upper case while much bigger themes, such as bitwise operators, still get left hanging in there although there is a much bigger community pressure and concerns
🆗 1
t
Ok
e
I’m with you. Unicode is killing our simple world we used to live in.