String length

Report a typo

Write an implementation of a function named getLength that returns the length of a String, or -1 if the string is null.

Sample Input 1:

Kotlin

Sample Output 1:

6
Write a program in Kotlin
fun getLength(input: String?): Int {
return 0
}
___

Create a free account to access the full topic