Flowdock
tr_s!(from, to) public

No documentation

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

Hide source
# File lib/jcode.rb, line 175
  def tr_s!(from, to)
    return self.delete!(from) if to.length == 0

    pattern = SqueezePatternCache[from] ||= /([#{_regex_quote(from)}])\1*/
    if from[0] == ?^
      last = /.$/.match(to)[0]
      self.gsub!(pattern, last)
    else
      h = HashCache[from + "1-0" + to] ||= expand_ch_hash(from, to)
      self.gsub!(pattern) do h[$1] end
    end
  end
Register or log in to add new notes.