Kotlin Удалить последний символ из строки
To remove last N characters from a String in Kotlin, use String. dropLast() method
Real Rattlesnake
To remove last N characters from a String in Kotlin, use String. dropLast() method
fun String.removeFirstLastChar(): String = this.substring(1, this.length - 1)
fun main(args: Array<String>) {
val myString= "Hello Everyone"
val result = myString.removeFirstLastChar()
println("First character is: $result")
}