Logo

Programming-Idioms

History of Idiom 169 > diff from v12 to v13

Edit summary for version 13 by programming-idioms.org:
[Ruby] +DocURL

Version 12

2018-01-27, 12:43:36

Version 13

2018-01-27, 12:44:31

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
Code
n = s.length
Comments bubble
n = s.size is the same
Doc URL
https://ruby-doc.org/core-2.3.0/String.html#method-i-length