erm....

    s.split("?").join("");

    is that any use?

    Glen



On 15/11/2010 19:17, Lehr, Theodore wrote:
OK - so what if I have multiple ? - s.replace("?", ""); "seems" to just get the 
first one....

________________________________________
From: flashcoders-boun...@chattyfig.figleaf.com 
[flashcoders-boun...@chattyfig.figleaf.com] On Behalf Of Glen Pike 
[postmas...@glenpike.co.uk]
Sent: Monday, November 15, 2010 1:34 PM
To: Flash Coders List
Subject: Re: [Flashcoders] Finda and Replace

Hi,

      For really simple replacements like single characters and strings,
you are probably better off using s.replace("?", "");

      For RegExp grab a copy of Grant Skinners RegExr tool - it's invaluable:

      http://gskinner.com/RegExr/desktop/

      HTH

      Glen

On 15/11/2010 17:26, Lehr, Theodore wrote:
Say you have the following string:

var s:String = "This is a test. Is this a test? Yes.";

I am trying:

var findAndReplace:RegExp = new RegExp("Is this a test?", "gi");
s=s.replace(findAndReplace,"xxx");

I would expect to get back:

This is a test. xxx Yes.

but there seem to be an issue with the ? - how would I handle a ? in this case?

Thanks!

Ted
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

_______________________________________________
Flashcoders mailing list
Flashcoders@chattyfig.figleaf.com
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to