stringSubstring

fun stringSubstring(text: String, start: Int, endInclusive: Int = text.length - 1): String

Computes the substring starting at start and ending at endInclusive, which is the length of text unless specified otherwise.