[ruby-talk:02428] String#tr

From: Quinn Dunkan <quinn@...>
Date: 2000-04-10 19:56:06 UTC
List: ruby-talk #2428
Ok, since that whole sub vs. gsub thing seems to have simmered down, I noticed
we have:

String#tr - translates search to replace, if search[0] == ?^ then translate
    not in search to replace

String#tr_s - do the same thing except squeeze the string, same logic for ^

Wouldn't this make more sense as

String#tr(search, replace [, flags]) where flags can be COMPLEMENT and SQUEEZE

In This Thread

Prev Next