03.05.2013 Views

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

FLASH® LITE™ 2.x - Adobe Help and Support

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Parameters<br />

start:Number - An integer that indicates the position of the first character of my_str used to<br />

create the substring. Valid values for start are 0 through String.length - 1. If start is a<br />

negative value, 0 is used.<br />

end:Number - An integer that is 1+ the index of the last character in my_str to be extracted.<br />

Valid values for end are 1 through String.length. The character indexed by the end<br />

parameter is not included in the extracted string. If this parameter is omitted, String.length<br />

is used. If this parameter is a negative value, 0 is used.<br />

Returns<br />

String - A substring of the specified string.<br />

Example<br />

The following example shows how to use substring():<br />

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

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

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

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 />

An example is also in the Strings.fla file in the ActionScript samples folder at<br />

www.adobe.com/go/learn_fl_samples. Download <strong>and</strong> decompress the .zip file <strong>and</strong> navigate to<br />

the folder for your version of ActionScript to access the sample.<br />

toLowerCase (String.toLowerCase method)<br />

public toLowerCase() : String<br />

Returns a copy of the String object, with all uppercase characters converted to lowercase.<br />

The original value is unchanged.<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 />

String 603

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

Saved successfully!

Ooh no, something went wrong!