I think Christian Lasarczyk wrote:
> 
> Jess> (call "test" replace "e" "t")
> "ttst"
> 
> works fine, but how to represent an empty String to emove all "e" ?
> 
> (call "test" replace "e" "")
> Jess reported an error in routine call
>       while executing (call "test" replace "e" "").
>   Message: No overloading of method 'replace' in class java.lang.String
> I can call with these arguments: (call "test" replace "e" "").
> ....

Well, if you can show me the working Java code which does this, I'll
show you how to implement it in Jess! :)

The method you're calling, String.replace(String, char, char), can't
change the length of the argument string. When I've needed to do what
you want to do in Java, I've always used a StringBuffer and a for-loop
to accumulate the characters I want to keep (does anybody know a
better way?) Although you -could- probably code this up in Jess, it'd
be simpler to write is as a Userfunction in Java.


---------------------------------------------------------
Ernest Friedman-Hill  
Distributed Systems Research        Phone: (925) 294-2154
Sandia National Labs                FAX:   (925) 294-2234
Org. 8920, MS 9012                  [EMAIL PROTECTED]
PO Box 969                  http://herzberg.ca.sandia.gov
Livermore, CA 94550

--------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the list
(use your own address!) List problems? Notify [EMAIL PROTECTED]
--------------------------------------------------------------------

Reply via email to