跳到主要内容

TRIM

Removes all spaces from a text string except for single spaces between words.

Syntax

expression.TRIM(arg1);

expression - A variable that represents a ApiWorksheetFunction class.

Parameters

NameRequired/OptionalData typeDefaultDescription
arg1RequiredApiRange | ApiName | stringThe text from which the spaces will be removed.

Returns

string

Example

let worksheet = Api.GetActiveSheet();
let func = Api.GetWorksheetFunction();
worksheet.GetRange("A1").SetValue(func.TRIM(" Online Office"));