Dynamic Drive Forums
>
General Coding
>
JavaScript
> /space replacement
PDA
View Full Version :
/space replacement
magicyte
10-20-2008, 01:42 AM
Is there any possible way to replace a space with in any string w/ JavaScript or PHP? It be best if you give me an example in JavaScript.
-magicyte
zaphod42
10-20-2008, 02:30 AM
var myString='this is my string'
myString.replace(/ /g,' ')
or
myString.replace(/( )/g,' ')
magicyte
10-20-2008, 11:12 PM
Thanks.
-magicyte
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.