fromCharCode 方法

从一些 Unicode 字符值中返回一个字符串。

function fromCharCode([code1 : Number [, ... [, codeN : Number]]]]) : String

参数

  • code1, ..., codeN
    可选。 要转换为字符串的 Unicode 字符值序列。 如果没有给出参数,结果为空字符串。

备注

fromCharCode 方法是从全局 String 对象中调用的。

示例

在下面的示例中,test 赋给“plain”字符串:

var test = String.fromCharCode(112, 108, 97, 105, 110);

要求

版本 3

应用于:

String 对象

请参见

参考

charCodeAt 方法