instance method each_char

Ruby on Rails 2.2.3

Since v2.2.3 Last seen in v2.3.18

Available in: v2.2.3 v2.3.18

Signature

each_char()

Yields a single-character string for each character in the string. When $KCODE = ‘UTF8’, multi-byte characters are yielded appropriately.

Source
# File activesupport/lib/active_support/core_ext/string/iterators.rb, line 14
        def each_char
          scanner, char = StringScanner.new(self), /./mu
          while c = scanner.scan(char)
            yield c
          end
        end

Defined in activesupport/lib/active_support/core_ext/string/iterators.rb line 14 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActiveSupport::CoreExtensions::String::Iterators

Type at least 2 characters to search.

↑↓ navigate · open · esc close