Click to See Complete Forum and Search --> : plus sign


xaviorg
02-01-2003, 12:47 PM
i have a var that contains plus signs (+) between words, so when i display its contents it looks like this:

Hi+there!

i tried var.replace('+', ' ')

but that didnt work, probably because the plus sign most likely said "Replace (') and (') with (' ')", so how do i get the replace function to recognize the plus sign as what to replace?

Charles
02-01-2003, 01:07 PM
<script type="text/javascript">
<!--
document.write('Hi+there'.replace(/\+/g, ' '));
// -->
</script>

xaviorg
02-01-2003, 01:13 PM
thanks :D