Logo

Programming-Idioms

History of Idiom 169 > diff from v66 to v67

Edit summary for version 67 by nopeslide:
New Erlang implementation by user [nopeslide]

Version 66

2019-09-26, 22:13:33

Version 67

2019-09-27, 09:34:20

Idiom #169 String length

Assign to integer n the number of characters of string s.

This can be different from the number of bytes of s.

Illustration

Idiom #169 String length

Assign to integer n the number of characters of string s.

This can be different from the number of bytes of s.

Illustration
Extra Keywords
size characters chars number runes
Extra Keywords
size characters chars number runes
Code
n = string:length(s)
Comments bubble
length(String::unicode:chardata()) -> integer() >= 0

Returns the number of grapheme clusters in String.
Doc URL
http://erlang.org/doc/man/string.html#length-1