Created
August 8, 2018 06:24
-
-
Save drulabs/bb230439006fe47cceb58ac49393cf3a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val blank = " ".isBlank() // true | |
val first = "Kaushal.Dhruw".substringBefore('.') // "Kaushal" | |
val last = "Kaushal.Dhruw".substringAfter('.') // "Dhruw" | |
val addSpaces = "1".padStart(2) // " 1" | |
val addSpacesEnd = "1".padEnd(3, '0') // "100" | |
val dropStart = "Dhruw".drop(2) // "ruw" | |
val dropEnd = "Dhruw".dropLast(2) // "Dhr" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment