CSE 154 Examples

Changing the Casing of a String

Description :

In Javascript, you can change all characters of a string to Upper Case using the toUpperCase() function and all characters to Lower Case using the toLowerCase() function.
The original string remains unchanged and a new string is returned.

Syntax : let changed_string = original_string.toUpperCase(); // Returns an uppercase copy of original_string

let changed_string = original_string.toLowerCase(); // Returns a lower case copy of original_string

Examples :

							 
	               let str = "Cats are the best!";
	               let replaced = str.toUpperCase();
						 	
	               replaced =  ?? 
             
							 
	               let str = "WE WERE ON A BREAK!"
	               let replaced = str.toLowerCase();
							 
	               replaced =  ??