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

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -