Kotlin String
16 functions
lengthstr.lengthReturns the length of the string.
substringstr.substring(startIndex, endIndex?)Returns a substring of the string.
containsstr.contains(other)Returns true if the string contains the specified other string.
startsWithstr.startsWith(prefix)Returns true if the string starts with the specified prefix.
endsWithstr.endsWith(suffix)Returns true if the string ends with the specified suffix.
replacestr.replace(oldValue, newValue)Returns a new string with all occurrences replaced.
trimstr.trim()Returns a string with leading and trailing whitespace removed.
uppercasestr.uppercase()Converts all characters to uppercase.
lowercasestr.lowercase()Converts all characters to lowercase.
splitstr.split(vararg delimiters)Splits the string into a list of substrings around the given delimiters.
joinToStringcollection.joinToString(separator)Creates a string from all the elements separated by the given separator.
isEmptystr.isEmpty()Returns true if the string is empty.
isBlankstr.isBlank()Returns true if the string is empty or consists of only whitespace.
padStartstr.padStart(length, padChar?)Returns a string of the specified length, padded at the start with padChar.
padEndstr.padEnd(length, padChar?)Returns a string of the specified length, padded at the end with padChar.
indexOfstr.indexOf(string)Returns the index of the first occurrence of the string, or -1.
