Skip to main content

MID

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

Syntax

expression.MID(arg1, arg2, arg3);

expression - A variable that represents a ApiWorksheetFunction class.

Parameters

NameRequired/OptionalData typeDefaultDescription
arg1RequiredApiRangeApiNamestring
arg2RequiredApiRangeApiNamenumber
arg3RequiredApiRangeApiNamenumber

Returns

string

Example

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