Logo

Programming-Idioms

History of Idiom 169 > diff from v67 to v68

Edit summary for version 68 by nopeslide:
[Erlang] identifiers starting with lowercase are atoms

Version 67

2019-09-27, 09:34:20

Version 68

2019-09-27, 09:47:57

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)
Code
N = string:length(S)
Comments bubble
length(String::unicode:chardata()) -> integer() >= 0

Returns the number of grapheme clusters in String.
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
Doc URL
http://erlang.org/doc/man/string.html#length-1