M
Michael W. Ryder
I am trying to figure out how to pass variables for the parameters to a
method. I want to do something like b = a.tr({c}, {d}) where 'c' is the
text to be matched and 'd' is the replacement text. Obviously the above
does not work, nor does b = a.tr(#{c}, ${d}). Is this even possible or
do I need to work out some regular expression to do the same thing.
What I am trying to do is have a method where I can say change all
periods to commas and commas to periods or change all *s to #s or ...
method. I want to do something like b = a.tr({c}, {d}) where 'c' is the
text to be matched and 'd' is the replacement text. Obviously the above
does not work, nor does b = a.tr(#{c}, ${d}). Is this even possible or
do I need to work out some regular expression to do the same thing.
What I am trying to do is have a method where I can say change all
periods to commas and commas to periods or change all *s to #s or ...