跳到主要内容

UNICODE

返回对应于文本第一个字符的数字(码位)。

语法

expression.UNICODE(arg1);

expression - 表示 ApiWorksheetFunction 类的变量。

参数

名称必需/可选数据类型默认值描述
arg1必需ApiRange | ApiName | string将返回其 Unicode 值的字符。

返回值

number

示例

此示例演示如何返回与文本第一个字符对应的编号(码位)。

// How to get a Unicode of a character.

// Use a function to return the character's Unicode.

let worksheet = Api.GetActiveSheet();
let func = Api.WorksheetFunction;
worksheet.GetRange("A1").SetValue(func.UNICODE("example"));