From: Oti <oh...@ya...> - 2002-03-12 22:26:47
|
Hello, I just stumbled over the following behaviour of string.replace(). Is it true I cannot pass a java.lang.String as first argument: [appl|pwe] > jython Jython 2.1 on java1.3.0 (JIT: null) Type "copyright", "credits" or "license" for more information. >>> import string >>> from java.lang import String >>> old = String( "old" ) >>> string.replace( old, "l", "d" ) Traceback (innermost last): File "<console>", line 1, in ? File "e:\jython21\Lib\string.py", line 409, in replace TypeError: replace(): expected 2 args; got 3 >>> string.replace( old.intern(), "l", "d" ) 'odd' Best wishes, and thanks, Oti. __________________________________________________ Do You Yahoo!? Try FREE Yahoo! Mail - the world's greatest free email! http://mail.yahoo.com/ |