Is there any built-in for `String` to ensure that ...
# announcements
p
Is there any built-in for
String
to ensure that a string ends with a certain character? Also called "append if missing" in some libraries. e.g.
foo("word", ".")
->
word.
foo("word.", ".")
->
word.
n
Kotlin does not have this built-in function, as far as I know. However, would this work for you?