summaryrefslogtreecommitdiff
path: root/doc/string/length.rdoc
blob: 544bca269f55118bf552a7afff3f13e44c481aaf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
Returns the count of characters (not bytes) in +self+:

  'foo'.length        # => 3
  'тест'.length       # => 4
  'こんにちは'.length   # => 5

Contrast with String#bytesize:

  'foo'.bytesize        # => 3
  'тест'.bytesize       # => 8
  'こんにちは'.bytesize   # => 15