function getFileName(str){ var reg = /[^\\\/]*[\\\/]+/g; //xxx\或者是xxx/ str = str.replace(reg,‘‘); return str; } var str2 = ‘user/550bbc9e0ad08fac0b39c147/3706934783.mp3‘; getFileName(str2)
时间: 2024-11-08 06:37:18
function getFileName(str){ var reg = /[^\\\/]*[\\\/]+/g; //xxx\或者是xxx/ str = str.replace(reg,‘‘); return str; } var str2 = ‘user/550bbc9e0ad08fac0b39c147/3706934783.mp3‘; getFileName(str2)