PDA

View Full Version : replace function?


ebrentnelson
04-19-2006, 02:22 PM
I am trying the following in a method:

this.getText( ).replace( "'", "\'" );

And it is coming back with an error saying that the replace function doesn't exists. Is it called something else?

Thanks

ebn

Azza
04-19-2006, 04:08 PM
Check out Appendix B of the Developer's Guide. It has the supported ECMA script functions and constructs...

http://www.openlaszlo.org/lps-latest/docs/guide/ecmascript-and-lzx.html

bfagan
04-20-2006, 01:16 PM
<method name="replace" args="text,c1,c2">
<![CDATA[
var arr = text.split(c1);
return arr.join(c2);
]]>
</method>