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 Chriss Miller 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
Joined
Apr 28, 2002
Messages
100
Location
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.

Similar threads

Part and Inventory Search

Sponsor

Back
Top