美文网首页
02_03.String

02_03.String

作者: Robyn_Luo | 来源:发表于2017-11-13 16:59 被阅读0次
 <script>
    // String.fromCodePoint
    // let codePoint = 101;
    // console.log(String.fromCodePoint(101)); // e

    // // String.prototype.codePointAt
    // let str = 'ABC';
    // console.log(str.codePointAt(1));  // 获取下标为1字符的编码

    // String.prototype.at
    let str = 'ABC';
    console.log(str.at(2)); // C
    </script>

相关文章

网友评论

      本文标题:02_03.String

      本文链接:https://www.haomeiwen.com/subject/ocwzmxtx.html