Logo

Programming-Idioms

History of Idiom 169 > diff from v108 to v109

Edit summary for version 109 by programming-idioms.org:
[Kotlin] Added Doc URL

Version 108

2022-06-27, 07:05:42

Version 109

2022-06-27, 07:08:54

Idiom #169 String length

Assign to the integer n the number of characters of the string s.
Make sure that multibyte characters are properly handled.
n can be different from the number of bytes of s.

Idiom #169 String length

Assign to the integer n the number of characters of the string s.
Make sure that multibyte characters are properly handled.
n can be different from the number of bytes of s.

Variables
n,s
Variables
n,s
Extra Keywords
size characters chars number runes
Extra Keywords
size characters chars number runes
Code
val n = s.length
Code
val n = s.length
Doc URL
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/length.html
Demo URL
https://pl.kotl.in/-lOWQHemI
Demo URL
https://pl.kotl.in/-lOWQHemI