OK - so what if I have multiple ? - s.replace("?", ""); "seems" to just get the
first one....
________________________________________
From: [email protected]
[[email protected]] On Behalf Of Glen Pike
[[email protected]]
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
> [email protected]
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders