截取字符串前几位var disName ='开心一族漂亮家园';
var shortName = disName.substring(0,5);
console.log(shortName);//打印结果:开心一族漂截取字符串后几位var disName ='开心一族漂亮家园';
var disLength = disName.length;
var shortName = disName.substring(disLength-2,disLength);
console.log(shortName);//打印结果:家园
本文链接:https://my.lmcjl.com/post/1172.html
展开阅读全文
4 评论