toUpperCase (String.toUpperCase method)

public toUpperCase() : String

Returns a copy of this string, with all lowercase characters converted to uppercase. The original string is unmodified.

This method converts all characters (not simply a-z) for which Unicode uppercase equivalents existThese case mappings are defined in the UnicodeData.txt file and the SpecialCasings.txt file, as defined in the Unicode Character Database specification.

Availability: ActionScript 1.0; Flash Player 5

Returns

String - A string.

Example

The following example creates a string with all lowercase characters and then creates a copy of that string using toUpperCase():

var lowerCase:String = "lorem ipsum dolor";
var upperCase:String = lowerCase.toUpperCase();
trace("lowerCase: " + lowerCase); // output: lowerCase: lorem ipsum dolor
trace("upperCase: " + upperCase); // output: upperCase: LOREM IPSUM DOLOR

For another example, see the Flash Samples page at www.adobe.com/go/learn_fl_samples. Download and decompress the Samples zip file and go to the ActionScript2.0\Strings folder to access the Strings.fla file.

See also

toLowerCase (String.toLowerCase method)


Flash CS3