Hi Luca,
Luca Morandini wrote:
> Hmmm... "replace" is a JavaScript function, not a Java one, hence I
> cannot understand how the string differences apply :(
>
> Anyway, I tried:
> var jfilters= new Packages.java.lang.String(filters);
> var re= new Packages.java.lang.String("/a/g");
> var s= new Packages.java.lang.String("b");
> jfilters.replace(re, b);
Nope, in this case you are not calling the javascript replace function,
which accept the /a/g syntax, but the java.lang.String.replace(char,
char) method, which only accept two chars.
How is the filter variable declared?
You could try one of the following :
var jsfilters = new String(filter);
var jsfilters = filters + '';
and then :
jsfilters.replace(/a/g,'b');
Hope this helps,
Simone
--
Simone Gianni
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]