var returnCode = function(str) {
var code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
var code1= 'abcdefghijklmnopqrstuvwxyz'
var restult = ''
for (var i = 0; i < str.length; i++) {
var a = str[i]
var index = code1.indexOf(a)
//判断是否存在
if(index>-1) {
restult+=code[index]
} else {
restult+=a
}
}
//返回结果
return restult
}
网友评论