Remove special characters from sentence

Hi All,

What is regular expression to remove special chars from a sentence and
replace spaces with hypen ??

Thanks,
Sandip R~

Ruby on Rails Developer

(teststring.gsub(/[^a-zA-Z 0-9]/, “”)).gsub(/\s/,’-’)

Sijo

Thanks Sijo !

On Mon, Jun 8, 2009 at 1:20 PM, Sijo Kg
[email protected]wrote:

(teststring.gsub(/[^a-zA-Z 0-9]/, “”)).gsub(/\s/,‘-’)

Sijo

Posted via http://www.ruby-forum.com/.


Ruby on Rails Developer