Skip to content

Commit

Permalink
use titlecase function for capitalizing first letter of word
Browse files Browse the repository at this point in the history
  • Loading branch information
westnordost committed Feb 7, 2023
1 parent 7f7a057 commit 1209eb7
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,5 @@ class Abbreviations(config: Map<String, String>, val locale: Locale) {
return this.matches(word)
}

private fun String.firstLetterToUppercase() =
this.substring(0, 1).uppercase(locale) + this.substring(1)
private fun String.firstLetterToUppercase() = get(0).titlecase(locale) + substring(1)
}

0 comments on commit 1209eb7

Please sign in to comment.