R
Ruby Newbee
Hi,
I want to delete the numbers in a string, for example,
x="abcd1234"
I have two ways:
x.gsub! /\d+/,""
x[/\d+/]=""
Which one is better?
I personally prefer the second one.
Thanks.
I want to delete the numbers in a string, for example,
x="abcd1234"
I have two ways:
x.gsub! /\d+/,""
x[/\d+/]=""
Which one is better?
I personally prefer the second one.
Thanks.