Object: String
Method or Function: toLowerCase(), toUpperCase()
Description: These methods are used to cover a string or alphabet from lower case to
upper case or vice versa. e.g: "and" to "AND".
Converting to Upper Case:
Example Code:
<script language=javascript>
var ss = " testing case conversion method ";
var result = ss.toUpperCase();
document.write(result);
</script>
Result:
Converting to Lower Case:
Example Code:
<script language=javascript>
var ss = " TESTING LOWERCASE CONVERT FUNCTION ";
var result = ss.toLowerCase();
document.write(result);
</script>
Result:
Explanation:
In the above examples,
toUpperCase() method converts any string to "UPPER" case letters.
toLowerCase() method converts any string to "lower" case letters.
|