Replaces contents of a string with value provided to it.
Parameters
- Character or string value to replace
- Start position to replace (Optional)
- Length to replace (Optional)
Example
Code Block |
---|
pjs.define("myString", { type: 'char', length: 11, initValue: 'Windsor, ON' }); myString = myString.replaceString('Toronto'); return myString; //"Toronto, ON" |
Code Block |
---|
pjs.define("myString", { type: 'char', length: 12, initValue: 'Lancaster, PA' }); myString = myString.replaceString('CA', 11); return myString; //"Lancaster, CA" |
RPG Equivalent
%REPLACE()