Sha256: d21109550ebce42730b485e8d9aaba03bfdec06c4bbf29aa2ce82d4427ba53bc
Contents?: true
Size: 410 Bytes
Versions: 2
Compression:
Stored size: 410 Bytes
Contents
unless '1.9'.respond_to?(:each_char) class String # Yields a single-character string for each character in the string. # When $KCODE = 'UTF8', multi-byte characters are yielded appropriately. def each_char require 'strscan' unless defined? ::StringScanner scanner, char = ::StringScanner.new(self), /./mu while c = scanner.scan(char) yield c end end end end
Version data entries
2 entries across 2 versions & 2 rubygems
Version | Path |
---|---|
activesupport-3.0.pre | lib/active_support/core_ext/string/iterators.rb |
recliner-0.0.1 | vendor/activesupport/lib/active_support/core_ext/string/iterators.rb |