String Case Methods

Description

Four methods perform case conversion: toLowerCase(), toLocaleLowerCase(), toUpperCase(), and toLocaleUpperCase().

The toLocaleLowerCase() and toLocaleUpperCase() methods are intended to be implemented based on a particular locale.

Example


var stringValue = "hello world";
console.log(stringValue.toLocaleUpperCase());  //"HELLO WORLD"
console.log(stringValue.toUpperCase());        //"HELLO WORLD"
console.log(stringValue.toLocaleLowerCase());  //"hello world"
console.log(stringValue.toLowerCase());        //"hello world"
//from   ww w .  j  a  v a2s  . c  o  m

The code above generates the following result.





















Home »
  Javascript »
    Javascript Introduction »




Script Element
Syntax
Data Type
Operator
Statement
Array
Primitive Wrapper Types
Function
Object-Oriented
Date
DOM
JSON
Regular Expressions