JavaScript 使用 split 函数从字符串中提取特定内容
const str = '20220317013044631_1000_1_9420543'; const arr = str.split('_'); const lastElement = arr[arr.length - 1]; console.log(lastElement); // prints '9420543'
原文地址: https://www.cveoy.top/t/topic/mM54 著作权归作者所有。请勿转载和采集!