美文网首页
charCodeAt() charAt() fromCharC

charCodeAt() charAt() fromCharC

作者: 蘑菇酱960903 | 来源:发表于2018-04-02 13:03 被阅读0次

str.charCodeAt(index) 返回索引index的字符编码
str.charAt(index) 返回索引index指定的字符
String.fromCharCode(num) 返回字符编码为num的字符

var str = 'this is a str'
undefined
str.charCodeAt(5)
105
str.charAt(5)
"i"
String.fromCharCode(105)
"i"

相关文章

网友评论

      本文标题:charCodeAt() charAt() fromCharC

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