need to write code which converts ABCDE in to abcde in java-script without using to-lowercase function.Write a function which returns the calling string value converted to lowercase. //function("ABCDE"); // return "abcde"
Asked
Active
Viewed 136 times
-3
-
`String.prototype.toLowerCase` – Eli Sadoff Apr 06 '17 at 01:56
-
1Post some code that you've tried. You will not get a favorable response on this site if you simply ask people to write code for you. Also, you should read "How to create a Minimum, Complete and Verifiable example". https://stackoverflow.com/help/mcve – James Milani Apr 06 '17 at 01:57
-
And read "How do I ask a good question?" too. https://stackoverflow.com/help/how-to-ask – James Milani Apr 06 '17 at 02:01
-
`yourStringOrVarThatIsAString.toLowerCase();` – StackSlave Apr 06 '17 at 02:01
-
1Possible duplicate of [Convert JavaScript String to be all lower case?](http://stackoverflow.com/questions/154862/convert-javascript-string-to-be-all-lower-case) – Jedi Apr 06 '17 at 03:29
2 Answers
1
Really?
addEventListener('load', function(){
function lame(string){
return string.toLowerCase();
}
console.log(lame('THIS is A LaMe Function'));
});

StackSlave
- 10,613
- 2
- 18
- 35
0
Use this method to convert
function convert(str) {
var result = ' ';
for (var i = 0; i < str.length; i++) {
var code = str.charCodeAt(i) // check if it's within the range of capital letters
if (code > 64 && code < 91) { // if so, add a new character to the result string // of the character from our code, plus 32
result += String.fromCharCode(code + 32) } else { // otherwise, just add the current character
result += str.charAt(i) } }
return result;
}
This may be helpful

Sri ram
- 90
- 4