-------------------------------1151504351
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
For your specific example, you can do this,
a="_exam@p_ (mailto:exam@p) Le3|
a.gsub!(/[^A-Za-z0-9]/,'')
p a
You can also eliminate elements you specify in an Array :
class Array
def eliminate_chars_from_this_array(text)
res=self.dup
res.each{|x| text.gsub!(Regexp.new(x),'') }
return text
end
end
array=["a","@","\247",","\'"]
a="_exam@p_ (mailto:exam@p) Le3|\247'"
a=array.eliminate_chars_from_this_array(a)
p a
Best regards,
Axel
-------------------------------1151504351--