string - Javascript- Uppercase letters to lower case and vise versa -


i interested in making uppercase letters lowercase , lowercase letters uppercase. if have code below code, should put in blank spaces of if/else statement: if (string[i] == ) , else if (string [i] == ). here rest of code:

      var sentence = "whats up! make me uppercase or lowercase";        var thestring = sentence.split("")        (var = thestring.length; >= 0; i--) {          if (thestring[i] == ) {            thestring[i].tolowercase();          }          else if (thestring [i] == ) {            thestring[i].touppercase();          }        }        var connectedsentence = thestring.join("");        console.log(connectedsentence); 

have made other mistakes? expected output make me uppercase or lowercase.

if (thestring[i] == thestring[i].touppercase()) {      thestring[i]=  thestring[i].tolowercase();      }      else if (thestring[i] == thestring[i].tolowercase()) {      thestring[i]=  thestring[i].touppercase();      } 

Comments

Popular posts from this blog

xml - Extract substrings with XSLT -

math - "ELO Rating" and how does "TSR Rating" work? -

How can do a tuple comparison in coffeescript similar to that in python? -