标签:位置 new str1 大写 bst div index return this
1.将lycrebate转换成LYC_REBATE
insertFlg (str1,n,str2) { //字符串替换
let s = str1.indexOf(n);
if(str1.length<s){
return str1+str2;
} else {
s1 = str1.substring(0,s);
s2 = str1.substring(s,str1.length);
let newStr = s1+str2+s2;
return newStr.toUpperCase();
}
},
insertFlag(lycrebate,"R", "_")
获得LYC_REBATE
标签:位置 new str1 大写 bst div index return this
原文地址:http://www.cnblogs.com/hui123-/p/7680179.html