Take first or last characters (Substring) with Kotlin
Sometimes you might want to get the last characters of the string or first characters. This is very easy with kotlin.
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
var variable = "New Things" | |
print(variable.take(6)) // # => New Th | |
print(variable.takeLast(6)) // # => Things |
Yorumlar
Yorum Gönder