Logo

Programming-Idioms

History of Idiom 169 > diff from v4 to v5

Edit summary for version 5 by steenslag:
New Ruby implementation by user [steenslag]

Version 4

2018-01-09, 21:49:55

Version 5

2018-01-09, 21:50: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.

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.

Extra Keywords
size
Extra Keywords
size
Code
n = s.length
Comments bubble
n = s.size is the same