let e = 111/222
let str = e
let index = e.lastIndexOf("/");
str = str.substring(0, index);
e = e.substring(index + 1, e.length);
let front = Number(str)
let after = Number(e)
console.log('前', front) // 111
console.log('后', after) // 222
分割出‘/’ 前面和后面的值
最新推荐文章于 2022-05-27 17:26:27 发布