Skip to main content

ASC

For double-byte character set (DBCS) languages, the function changes full-width (double-byte) characters to half-width (single-byte) characters.

Syntax

expression.ASC(arg1);

expression - A variable that represents a ApiWorksheetFunction class.

Parameters

NameRequired/OptionalData typeDefaultDescription
arg1RequiredApiRange | ApiName | stringThe text or a reference to a cell containing the text to change.

Returns

string

Example

Convert full-width characters to half-width for DBCS languages in a spreadsheet.

// Apply the ASC function to change character width in a spreadsheet.

// Reduce character size by converting from double-byte to single-byte in a spreadsheet.

let worksheet = Api.GetActiveSheet();
let func = Api.WorksheetFunction;
worksheet.GetRange("A1").SetValue(func.ASC("text"));