Logo

Programming-Idioms

History of Idiom 169 > diff from v11 to v12

Edit summary for version 12 by programming-idioms.org:
New Ruby implementation by user [programming-idioms.org]

Version 11

2018-01-27, 12:34:28

Version 12

2018-01-27, 12:43:36

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.size
Doc URL
https://ruby-doc.org/core-2.3.0/String.html#method-i-size