string.translate()
Translates characters in a string according to the From and To parameters, which hold a string of characters to translate.Â
Parameters
From - String of characters to look for
To - Corresponding string of characters to replace From characters with
Start position (optional) - the first character is considered position 1; if omitted, the entire string is processed
const Upper = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
const Lower = 'abcdefghijklmnopqrstuvwxyz'
pjs.define('myString', { type: 'char', length: 15, initValue: 'MYSTRING'});
myString = myString.translate(Upper, Lower);
return myString;
// 'mystring'
RPG Equivalent
%XLATE(), XLATE