Here’s the implementation of substring(range: IntRange). If start is not included, it is assumed to equal to 0.. end: The terminating index of the substring.The character at this index is NOT included in the substring. Returns a substring of chars from a range of this char sequence starting at the startIndex and ending right before the endIndex. Returns the substring starting from the specified index i.e beginIndex and extends to the character present at the end of the string. Kotlin for Native. Kotlin for JavaScript. endIndex - the end index (exclusive). String Substring Example 1 - substring (int beginIndex) Returns a string that is a substring of this string. This would translate to a simple code below: 1 If the endIndex is not passed, the substring begins with the character at the specified index and extends to the end of the string. Go to the Spring Initializr website and type in the following information: Project: Gradle Project; Language: Kotlin Split string kotlin example. OK. Kotlin; val ok = s.contains(word) Since literals in Kotlin are implemented as instances of String class, you can use several methods and properties of this class.. length property - returns the length of character sequence of an string. www.tutorialkart.com - ©Copyright-TutorialKart 2018, Kotlin - Class, Primary and Secondary Constructors, Kotlin - Primary Constructor call expected, Kotlin - Null can not be a value of a non-null type String, Kotlin - Cannot create an instance of an abstract class, Kotlin - Iterate through all files in a directory, How to Learn Programming? Idioms. Contribute to bazelbuild/rules_kotlin development by creating an account on GitHub. Function name String is an array of characters. A function returns a value, and a methodis a function associated to an object. This is optional and if we don’t provide it, the full string is returned. /** * Kotlin - String.substring() */ fun main(args: Array