Mike Savvy wrote:. . . source: Geeks For Geeks
They are dreadfully out of date if they are using StringBuffer. I also don't think it is a very elegant technique because it uses append() repeatedly.
If your ß and similar produce two letters instead of one, you might consider remove and insert, but as far as I know, ß is
never used as a first letter, so that problem might not apply.
My suggestion doesn't alter the state of letters after the first letter in a word; you could consider an
else...toLowerCase(...) to do that.