Force String to Lower or Upper Case

JavaScript has built in methods to manipulate strings making this task easy. You can call the toLowerCase() or toUpperCase() on the string directly.

Make a string lower case.

var str = "Hello World!";
var lowerCaseStr = str.toLowerCase();

Make a string upper case.

var str = "Hello World!";
var upperCaseStr = str.toUpperCase();

Leave a Reply

Your email address will not be published. Required fields are marked *