Answers for "how to read char in kotlin"

0

Kotlin get char in string

val hello = "Hello World"

    // Using get() function
    val W = hello.get(6)

    // Using indexing
    val e = hello[1]
Posted by: Guest on October-27-2020
0

how to get char input in kotlin

import java.util.Scanner

fun main(args: Array<String>) {
    val scanner = Scanner(System.`in`)
    val chr = scanner.next().single()
}
Posted by: Guest on July-21-2020

Browse Popular Code Answers by Language