📌  相关文章
📜  VueJS - 获取拆分字符串数组的最后一个元素 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:06.555000             🧑  作者: Mango

代码示例1
const str = "hello,how,are,you,today?"
const pieces = str.split(/[\s,]+/)
const last = pieces[pieces.length - 1]

console.log({last})
 Run code snippet