Skip to main content

CLEAN

Removes all the nonprintable characters from the text.

Syntax

expression.CLEAN(arg1);

expression - A variable that represents a ApiWorksheetFunction class.

Parameters

NameRequired/OptionalData typeDefaultDescription
arg1RequiredApiRange | ApiName | stringA string from which nonprintable characters will be removed.

Returns

string

Example

Remove invisible control characters from imported or pasted text in a spreadsheet.

// Eliminate all nonprintable characters that don't display properly in your cells in a spreadsheet.

// Purify text data by stripping out hidden formatting and special characters in a spreadsheet.

let worksheet = Api.GetActiveSheet();
let func = Api.WorksheetFunction;
worksheet.GetRange("A1").SetValue(func.CLEAN("\ntext"));