Sha256: fc4c70151969aeedeab8230dd86da7231939f9d84478a48cb2c22a86ab8a1db0
Contents?: true
Size: 368 Bytes
Versions: 76
Compression:
Stored size: 368 Bytes
Contents
# encoding: utf-8 require 'open_classes/numeric/is_ascii' # String class String # count string size. ascii => count1, not ascii => count2 # def ascii1_other2_size chars.to_a.reduce(0) do |sum, v| case v.ord when 65_393..65_437 sum += 1 when 1..127 sum += 1 else sum += 2 end sum end end end
Version data entries
76 entries across 76 versions & 1 rubygems