From: Troy Denkinger Date: 2006-06-29T02:11:09+09:00 Subject: Re: remove all illegal chars form string ------=_Part_55961_7779936.1151503981731 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable Content-Disposition: inline This is definitely regex territory. And gsub() is the thing: ex =3D "exam@p Le3|=A7" puts ex.gsub( /[^A-Za-z0-9]/, '' ) > exampLe3 Or puts "exam@p Le3|=A7".gsub( /[^A-Za-z0-9]/, '' ) > exampLe3 I assume you wanted the 3 in there, since you asked for numbers in your range of characters. Whe doing something like this, in my opinion, it's best to not try to roll your own. ------=_Part_55961_7779936.1151503981731--