method

_expand_ch

Importance_0
Ruby latest stable (v2_5_5) - 0 notes - Class: String

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v1_8_7_330) is shown here.

_expand_ch(str) private

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/jcode.rb, line 99
  def _expand_ch str
    a = []
    str.scan(/(?:\\(.)|([^\\]))-(?:\\(.)|([^\\]))|(?:\\(.)|(.))/m) do
      from = $1 || $2
      to = $3 || $4
      one = $5 || $6
      if one
        a.push one
      elsif from.length != to.length
        next
      elsif from.length == 1
        from[0].upto(to[0]) { |c| a.push c.chr }
      else
        from.upto(to) { |c| a.push c }
      end
    end
    a
  end
Register or log in to add new notes.