string 的指定字符串截取

var str = 'ABCDEFG';
console.log(str.split("C")[1]);   // DEFG

console.log(str.match(/B(.*)/)[1]);  // CDEFG

如果str.split("C")[0]  是【0】那就是截取前面在字符串

猜你喜欢

转载自blog.csdn.net/weixin_42348071/article/details/82657526
今日推荐