首页 > Web开发 > 详细

js String方法集合

时间:2015-09-01 18:24:23      阅读:179      评论:0      收藏:0      [点我收藏+]
//https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String
//
返回对应索引的字符 chartAt() //返回对应所引的字符的统一码(Unicode value) charCodeAt() //Returns a non-negative integer that is the UTF-16 encoded code point value at the given position. codePointAt(); //拼接两个字符串,并返回一个新的字符串 concat(); //Determines whether one string may be found within another string. includes(); //Determines whether a string ends with the characters of another string. endsWidth(); //返回一个字符串在另一个字符串中首次出现的位置,如果查找不到,返回-1 indexOf(); //返回一个字符串在另一个字符串中末次出现的位置,如果查找不到,返回-1 lastIndexOf(); //Returns a number indicating whether a reference string comes before or after or is the same as the given string in sort order. localeCompare(); //用字符串匹配一个字符串 mach(); //Returns the Unicode Normalization Form of the calling string value. normalize(); //Returns a string consisting of the elements of the object repeated the given times. repeat(); //找出字符串中和正则表达式匹配的部分,并用一个新的子串替换 replace(); //找出字符串中和正则表达式匹配的部分 search(); //截取字符串的一部分返回 slice(); //把一个字符串分割成数组,分割点为传入的子串 split(); //Returns the characters in a string beginning at the specified location through the specified number of characters. substr(); // substring(); // toLocalLowerCase(); // toLocalUpperCase(); toLowerCase(); toSource(); toString(); toUpperCase(); trim(); valueOf();

 

js String方法集合

原文:http://www.cnblogs.com/flyfly/p/4776405.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!