1、例如截取xxx.txt 点后面和前面的值
var str1 = "xxxaaa.txt";
var str2 = "xxxbbb.txt";
var str3 = "xxxccc.txt";
document.write(str1.split(':')[0]) //输出xxxaaa
document.write(str1.split(':')[1]) //输出txt
1、例如截取xxx.txt 点后面和前面的值
var str1 = "xxxaaa.txt";
var str2 = "xxxbbb.txt";
var str3 = "xxxccc.txt";
document.write(str1.split(':')[0]) //输出xxxaaa
document.write(str1.split(':')[1]) //输出txt