MID

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

Description

Returns the characters from the middle of a text string, given a starting position and length.

Parameters

arg1stringdefault: null

The text string from which to extract the characters.

arg2numberdefault: null

The position of the first character to extract. The first text character is 1.

arg3numberdefault: null

A number of the characters to extract.

Returns

string

Try It

var oWorksheet = Api.GetActiveSheet();
var oFunction = Api.GetWorksheetFunction();
oWorksheet.GetRange("A1").SetValue(oFunction.MID("Online Office", 3, 4));

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).