SPACE REMOVAL WITH REG EXP
Hi,
This is removs the trailing and leading spaces in a string but not in the middle.
nTxt = nTxtObj.value.replace(/^\s+|\s+$/g,"")
example:
string = " RR55 JJ 12 "
becomes
string = "RR55 JJ 12"
What do I have to do to get rid of the spaces in the middle as well so that I get this:
string = "RR55JJ12"
Cheers
P
|