-
-
Save tin80122/14cb7770618ad4380a0435f01294a33f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var toLowerCase = function(str) { | |
var ary = str.split(''); | |
for(var i = 0 ; i < ary.length ; i++){ if(ary[i] >= 'A' && ary[i] <= 'Z'){ | |
var code = ary[i].<strong>charCodeAt</strong>(0) + 32; | |
ary[i] = String.<strong>fromCharCode</strong>(code); | |
} | |
} | |
var newStr = ary.join(''); | |
return newStr; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment