The following methods are available in string:
1. touppercase () converts each letter in the string into uppercase letters.
2. tolowercase () converts each letter in the string to lowercase.
Using these two functions, we can convert English strings into uppercase and lowercase letters.
VaR STR = 'tracy '; toupper (STR); // convert to upper-case function toupper (STR) {var result = Str. touppercase (); console. Log (result );}
// Convert it to lower-case var SSTR = 'lil'; tolower (SSTR); function tolower (SSTR) {var result = SSTR. tolowercase (); console. Log (result );}
One question: Convert the first letter of each word into uppercase letters in the input string (containing multiple words.
// Convert the first letter of each word in the string to uppercase var words = "I am a student. "; changefirstletter (words); function changefirstletter (words) {var arr = words. split (""); For (VAR I = 0; I <arr. length; I ++) {arr [I] = arr [I]. charat (0 ). touppercase () + arr [I]. slice (1);} return console. log (ARR. join (""));}
Conversion of uppercase and lowercase letters