REPLACEB

function REPLACEB(
  arg1: string = null,
  arg2: number = null,
  arg3: number = null,
  arg4: string = null,
): string

Description

Replaces a set of characters, based on the number of characters and the start position specified, with a new set of characters and is intended for languages that use the double-byte character set (DBCS) like Japanese, Chinese, Korean etc.

Parameters

arg1stringdefault: null

The text where some characters will be replaced.

arg2numberdefault: null

The position of the character in the original text that will be replaced with the new text.

arg3numberdefault: null

The number of characters in the original text that will be replaced, based on bytes.

arg4stringdefault: 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.REPLACEB("Online Office", 8, 6, "portal"));

Get Help

  • If you have any questions about ONLYOFFICE Docs, try the FAQ section first.
  • You can request a feature or report a bug by posting an issue on GitHub.
  • You can also ask our developers on ONLYOFFICE forum (registration required).