T
Checks whether a value is text, and returns the text if it is, or returns double quotes (empty text) if it is not.
Syntax
expression.T(arg1);
expression - A variable that represents a ApiWorksheetFunction class.
Parameters
| Name | Required/Optional | Data type | Default | Description |
|---|---|---|---|---|
| arg1 | Required | ApiRange | ApiName | number | string | boolean | The value to test. |
Returns
Example
Check whether a value is text, and return the text if it is, or returns double quotes (empty text) if it is not in a spreadsheet.
// Test if a value is text using the T function and return accordingly.
// Returns the text value if the input is text, otherwise returns empty string.
let worksheet = Api.GetActiveSheet();
let func = Api.WorksheetFunction;
worksheet.GetRange("A1").SetValue(func.T("date and time"));