js截取字符串的后几位数

代码如下:

var str="abcdefghhhh";//截取后4位
str.substring(str.length-4);

 

posted @ 2018-06-26 16:58  兔子先生i  阅读(129295)  评论(0编辑  收藏  举报