Contemplations
The world is changed.
I feel it in the water.
I feel it in the earth.
I smell it in the air.
Much that once was is lost, for none now live who remember it.
— Galadriel (The Fellowship of the Ring)
The world is changed.
I feel it in the water.
I feel it in the earth.
I smell it in the air.
Much that once was is lost, for none now live who remember it.
— Galadriel (The Fellowship of the Ring)
Kotlin adds the substringBefore, substringBeforeLast, substringAfter and substringAfterLast extension functions to the String class. Instead of using indices to get a substring you can use a string or character value. The functions without Last use the first occurrence of the delimiter and the methods with Last use the last occurrence. If the delimiter is not found the original string is returned. You can supply a value that should be returned when the delimiter is not found.