mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
2000-02-08
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@616 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
25be6ce9b5
commit
320e99d8dd
33 changed files with 1157 additions and 516 deletions
|
@ -161,7 +161,7 @@ class String
|
|||
def tr_s!(from, to)
|
||||
return self.delete!(from) if to.length == 0
|
||||
|
||||
pattern = SqueezePatternCache[from] ||= /([#{bsquote(from)}])\1+"/
|
||||
pattern = SqueezePatternCache[from] ||= /([#{bsquote(from)}])\1+"/ #"
|
||||
if from[0] == ?^
|
||||
last = /.$/.match(to)[0]
|
||||
self.gsub!(pattern, last)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue