js对字符串的操作

1、charCodeAt(index);  

返回一个整数,代表下标位置上字符的Unicode的编码。

2.fromCharCode(code1,code2,code3,...);

code1代表Unicode编码数

3、charAt(index);

返回指定下标的字符,超出返回一个空字符。

4.slice(start,end);

注:end下标不包括自己本身

下标start、end可以为负数,如果为为负数,则作为length+start/end处理。

5、substring(start,end);

6、substr(index,length);

7、indexOf(str,strIndex);

8、lastIndexOf(str,strIndex);

9、search(reExp);

10、concat(str,str1,...);

11、toUpperCase();

12、split(separator,limit);

原文地址:https://www.cnblogs.com/zhouyideboke/p/14886302.html