| Summary: | JS: only first instance of substring is replaced using replaceStr | ||
|---|---|---|---|
| Product: | z_Archived | Reporter: | Kathy Carroll <carrollk> |
| Component: | EDT | Assignee: | Project Inbox <edt.javascriptgen-inbox> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | greer |
| Version: | unspecified | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
Added correct impl. of replaceStr, verified provided testcase. Verified with 0.7.0v201109080902. Closing this defect. |
handler MyHandler type RUIhandler {onConstructionFunction = start, cssFile="css/Alpha.css", title="MyHandler"} function start() SysLib.WriteStdOut("Hello from JavaScript Batch"); replaceTest(); end function replaceTest() actualStr String = "abcdefabcdefabcdefab".replaceStr("abc", "xyz"); expectedStr string = "xyzdefxyzdefxyzdefab"; if (actualStr == expectedStr) syslib.writeStdout("works"); else syslib.writeStdout("fails"); syslib.writeStdout(actualStr); syslib.writeStdout(expectedStr); end end end Output is: Hello from JavaScript Batch fails xyzdefabcdefabcdefab xyzdefxyzdefxyzdefab