Hello,

Last week, we replaced Sentry's StringUtils.capitalize() method with Spring's capitalize() method. We expected to work the same with Sentry's method, upper-case the first letter and lower-case the remaining letters. But, in the current implementation, only the first letter is changing and the remaining part remains as it is. It misleads the usage because capitalization means making the first letter uppercase and the remaining letters lowercase. I am leaving some examples from different languages. I think we should fix the algorithm that works as expected. Or, change the method name to avoid misleads. I am here to make changes if you want.

Examples from different languages

  • https://www.w3schools.com/python/ref_string_capitalize.asp
  • https://github.com/getsentry/sentry-java/blob/9762f09afa51944b40a9b77e116a55e54636e6c5/sentry/src/main/java/io/sentry/util/StringUtils.java#L47

Comment From: bclozel

duplicates #21367