mirror of
https://github.com/ruby/ruby.git
synced 2026-01-27 12:34:21 +00:00
12 lines
274 B
Plaintext
12 lines
274 B
Plaintext
Returns the count of characters (not bytes) in +self+:
|
|
|
|
'foo'.length # => 3
|
|
'こんにちは'.length # => 5
|
|
|
|
Contrast with String#bytesize:
|
|
|
|
'foo'.bytesize # => 3
|
|
'こんにちは'.bytesize # => 15
|
|
|
|
Related: see {Querying}[rdoc-ref:String@Querying].
|