File: string_length.rb

package info (click to toggle)
ruby-backports 3.25.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,912 kB
  • sloc: ruby: 11,757; makefile: 6
file content (10 lines) | stat: -rw-r--r-- 180 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
# encoding: utf-8

class String
  if "é".length > 1 && "é".scan(/./).length == 1
    def length
      unpack("U*").length
    end
    alias_method :size,       :length
  end
end