Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

String.replace (regexpr)

Status
Not open for further replies.

kasuals

Programmer
Apr 28, 2002
100
US
This should work shouldn't it?

<script language=&quot;JavaScript1.2&quot;>
var tString = &quot;\&quot;LOSING MY MIND!!!\&quot;&quot;;
tString.replace(/&quot;([^&quot;]*)&quot;/g, &quot;$1&quot;);
document.write(&quot;&quot;+tString+&quot;&quot;);
</script>

I'm losing my mind... I can't seem to isolate the double-quotes... any other character seems to work fine...
 
The [COLOR=aa0000]
Code:
replace
[/color] method does not alter its parent object. Rather, it does its duty by returning the String on which the replacements took place.

[COLOR=aa0000]
Code:
tString=tString.replace(/&quot;([^&quot;]*)&quot;/g, &quot;$1&quot;);
[/color]
Code:
- UNIMENT
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top