字符串方法

substr(start,length);

substring(start,end); (包括start,不包含end)   与 slice() 和 substr()  splice方法不同的是,substring() 不接受负的参数。

slice(start,end);   如果是负数,那么它规定从数组尾部开始算起的位置。也就是说,-1 指最后一个元素,-2 指倒数第二个元素,以此类推。

!!!!!splice(start,length); splice是数组方法,字符串没有该方法

posted @ 2020-11-29 16:25  sunmarvell  阅读(62)  评论(0编辑  收藏  举报