RSS

Javascript to remove Special Characters

05 May

Use this to remove special characters from a string, in other words, find a special character pattern and replace it with empty character,

str = str.replace(/[^a-zA-Z 0-9]+/g,”);

 
Leave a comment

Posted by on May 5, 2011 in Javascript

 

Tags: ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: