...

View Full Version : Remove characters



Hirameck
05-01-2004, 09:08 AM
Hi!
How do I remove white spaces, special characters, change to upper case in one expression?

e.g. j a(/"Va"scr ipt. 12 &
should return - JAVASCRIPT12
THANKS :mad:

swmr
05-01-2004, 01:51 PM
This seems to work:

var s = "j a(/\"Va\"scr ipt. 12 &";
alert(s.replace(/[^0-9a-z]/gi, "").toUpperCase());



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum