REPLACE
function REPLACE(
arg1: string = null,
arg2: number = null,
arg3: number = null,
arg4: string = null,
): string
Description
Replaces part of a text string with a different text string.
Parameters
- arg1
string
null The text where some characters will be replaced.
- arg2
number
null The position of the character in the original text that will be replaced with the new text.
- arg3
number
null The number of characters in the original text that will be replaced.
- arg4
string
null The text that will replace characters in the original text.
Returns
string
Try It
var oWorksheet = Api.GetActiveSheet();
var oFunction = Api.GetWorksheetFunction();
oWorksheet.GetRange("A1").SetValue(oFunction.REPLACE("Online Office", 8, 6, "portal"));