/* charAt() 返回指定索引位置的字符
var str=“helloworld”;
var newArr = str.charAt(1);
alert(newArr);*/
/charCodeAt() 返回在指定的位置的字符的 Unicode 编码。
var str = “helloworld”;
var newArr = str.charCodeAt(3);
alert(newArr);/
/concat() 连接两个或更多字符串,并返回新的字符串。
var str = “helloworld”;
var newArr = str.concat(110,888);
alert(newArr);/
/*fromCharCode() 将 Unicode 编码转为字符。
var newArr = String.fromCharCode(98,97,96,95);
alert(newArr);*/
/indexOf() 返回某个指定的字符串值在字符串中首次出现的位置。
var str = “helloworld”;
var newArr = str.indexOf(“o”);
alert(newArr);/
/lastIndexOf() 从后向前搜索字符串,并从起始位置(0)开始计算返回字符串最后出现的位置。
var str = “helloworld”;
var newArr = str.lastIndexOf(“o”);
alert(newArr);/
/match() 查找找到一个或多个正则表达式的匹配。
var str = “hellowhellhello”;
var newArr = str.match(/lo/g);
alert(newArr);/
/* repeat() 复制字符串指定次数,并将它们连接在一起返回。
var str = "hellowhellhello";
var newArr = str.repeat(3);
alert(newArr);*/
/replace() 在字符串中查找匹配的子串, 并替换与正则表达式匹配的子串。
var str = “hellowhellhello”;
var newArr = str.replace(“hello”,“ppppp”);
alert(newArr);
/search() 查找与正则表达式相匹配的值。
var str = “hellowhellhello”;
var newArr = str.search(/ll/);
alert(newArr);/
/slice() 提取字符串的片断,并在新的字符串中返回被提取的部分。
var str = “hellowhellhello”;
var newArr = str.slice(1,3);
alert(newArr);/
/*split() 把字符串分割为字符串数组。
var str = "hellowhellhello";
var newArr = str.split("");
alert(newArr);*/
/substr() 从起始索引号提取字符串中指定数目的字符。
var str = “hellowhellhello”;
var newArr = str.substr(1,4);
alert(newArr);/
/substring() 提取字符串中两个指定的索引号之间的字符。
var str = “hellowhellhello”;
var newArr = str.substr(2,4);
alert(newArr);/