字符串分割 var keyValue = 'string'function getStr(string,str){ var currentKey = string.split(str)[0]; var currentValue = string.split(str)[1]; console.log('前'+ currentKey + '后' + currentValue);} getStr(keyValue,'r')
var keyValue = 'string'
function getStr(string,str){
var currentKey = string.split(str)[0];
var currentValue = string.split(str)[1];
console.log('前'+ currentKey + '后' + currentValue);
}
getStr(keyValue,'r')
