如何使用js中的String.fromCodePoint 函数

 时间:2024-10-12 21:52:21

1、语法String.fromCodePoint(...codePoints);

如何使用js中的String.fromCodePoint 函数

2、参数codePoints必需。指定一个或多个 UTF-16 码位值的 rest 参数。

3、备注如果...codePoints不是有效的 UTF-16 码位,此函数将引发RangeError异常。

4、示例var str1 = String.fromCodePoint(0x20BB7);var str2 = String.fromCodePoint(98);var str3 = String.fromCodePoint(97, 98, 99);if(console && console.log) { console.log(str1); console.log(str2); console.log(str3);}// Output:// 𠮷// b// abc

如何使用js中的String.fromCodePoint 函数

5、要求Microsoft Edge(E蟠校盯昂dge 浏览器)中受支持。应用商店应用(Windows 10 上的 M足毂忍珩icrosoft Edge)中也受支持。请参阅版本信息。在以下文档模式中不受支持:Quirks、Internet Explorer 6 标准模式、Internet Explorer 7 标准模式、Internet Explorer 8 标准模式、Internet Explorer 9 标准模式、Internet Explorer 10 标准模式和 Internet Explorer 11 标准模式。在 Windows 8.1 中不受支持。

  • SpringBoot22-在html引入thymeleaf提示并使用
  • jsp出现&nbsp字符实体怎么去除
  • c# 如何使用 单例模式
  • MyEclipse部署,将一个项目引入到两个项目;
  • iframe去掉滚动条依然能滚动的方法
  • 热门搜索
    惠普笔记本怎么样 保险怎么买 简历怎么做 萝卜炖肉的家常做法 为什么长痤疮 孕吐怎么样才可以缓解 丝瓜怎么做好吃 天空为什么是蓝色的 春节用英语怎么说 水样白带是怎么回事