LEFT

LEFT(arg1, arg2) → { string }

Returns the specified number of characters from the start of a text string.

Parameters:

Name Type Description
arg1 string

The text string containing the characters to extract.

arg2 number

A number of the substring characters. It must be greater than or equal to 0.

Returns:

Type
string

Example

Copy code
builder.CreateFile("xlsx");
var oWorksheet = Api.GetActiveSheet();
var oFunction = Api.GetWorksheetFunction();
oWorksheet.GetRange("A1").SetValue(oFunction.LEFT("Online Office", 6));
builder.SaveFile("xlsx", "LEFT.xlsx");
builder.CloseFile();

Resulting document