常用于截取文件名,或者文件后缀
let lis = res.data.data.rowsfor (let i = 0; i < lis.length; i++) {const splitArray = lis[i].projectFileStr.split('/')const substring = splitArray[splitArray.length - 1]lis[i].name = substringconst Arrays = lis[i].projectFileStr.split('.')const substr = Arrays[Arrays.length - 1]console.log(substr)lis[i].format = substr}list.value = lis
//示例
let string = 'yellow.png'const Arrays =string.split('.')const substr = Arrays[Arrays.length - 1]console.log(substr) //打印出来 'png'