
String.toUpperCase() Method
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
816
|
ActionScript Language Reference
// Perform a case-insensitive comparison of two strings
function caseInsensitiveCompare (stringA, stringB) {
return (stringA.toLowerCase() = = stringB.toLowerCase());
}
trace(caseInsensitiveCompare("Colin", "colin")); // Displays: true
See Also
String.toUpperCase(); “The toLowerCase() function,” in Chapter 4
String.toUpperCase() Method
generate an uppercase version of a string
Flash 5
string.toUpperCase()
Returns
The uppercase (a.k.a. ALL CAPS) equivalent of string as a new string. Characters without
an uppercase equivalent are left unchanged.
Description
The toUpperCase() method creates a new, uppercase version of string; it can be used for
formatting or for facilitating case-insensitive character comparisons.
Usage
Note that toUpperCase() does not modify string; it returns a completely new string.
Example
"listen to me".toUpperCase(); // Yields the string "LISTEN TO ME"
var msg1 = "Your Final Score: 234";
var msg2 = msg1.toUpperCase(); // Set msg2 to "YOUR FINAL SCORE: 234"
See Also
String.toLowerCase() ; “The toUpperCase() function,” in Chapter 4
super “Operator”
invoke an object’s superclass constructor, or invoke a superclass’s implementation of an overridden method
Flash 6
super(arg1, arg2,...argn);
super.methodName(arg1, arg2