03.05.2013 Views

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

ActionScript 2.0 Language Reference - Adobe Help and Support

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

The following example shows what happens if a negative start parameter is used:<br />

var my_str:String = "Hello world";<br />

var mySubstring:String = my_str.substring(-5,5);<br />

trace(mySubstring); // output: Hello<br />

For another example, see the Flash Samples page at www.adobe.com/go/learn_fl_samples.<br />

Download <strong>and</strong> decompress the Samples zip file <strong>and</strong> go to the <strong>ActionScript</strong><strong>2.0</strong>\Strings folder<br />

to access the Strings.fla file.<br />

toLowerCase (String.toLowerCase method)<br />

public toLowerCase() : String<br />

Returns a copy of this string, with all uppercase characters converted to lowercase. The<br />

original string is unmodified.<br />

This method converts all characters (not simply A-Z) for which Unicode lowercase<br />

equivalents exist. These case mappings are defined in the UnicodeData.txt file <strong>and</strong> the<br />

SpecialCasings.txt file, as defined in the Unicode Character Database specification.<br />

Availability: <strong>ActionScript</strong> 1.0; Flash Player 5<br />

Returns<br />

String - A string.<br />

Example<br />

The following example creates a string with all uppercase characters <strong>and</strong> then creates a copy of<br />

that string using toLowerCase() to convert all uppercase characters to lowercase characters:<br />

var upperCase:String = "LOREM IPSUM DOLOR";<br />

var lowerCase:String = upperCase.toLowerCase();<br />

trace("upperCase: " + upperCase); // output: upperCase: LOREM IPSUM DOLOR<br />

trace("lowerCase: " + lowerCase); // output: lowerCase: lorem ipsum dolor<br />

For another example, see the Flash Samples page at www.adobe.com/go/learn_fl_samples.<br />

Download <strong>and</strong> decompress the Samples zip file <strong>and</strong> go to the <strong>ActionScript</strong><strong>2.0</strong>\Strings folder<br />

to access the Strings.fla file.<br />

See also<br />

toUpperCase (String.toUpperCase method)<br />

String 1157

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!