endsWith

open fun endsWith(longer: CharSequence, shorter: CharSequence): Boolean(source)

Checks whether the fist CharSequence ends with the second. If the charAt method of both sequences is fast, this check is faster than converting them to Strings and using endsWith.