Develop PHP Website for Learning Web Design Free Online
  Home   |   Forums   |   DevCMS
  Join   |   Log In
 
   

Actionscript 3.0 Tutorials - Learn Actionscript 3.0

Tutor at Develop PHP
Split Or Explode Strings
By: Adam      Created: Jul 07, 2009      Views: 1118 Tweet This Page  Post page to Facebook  Post page to Facebook

If there comes a time when you need to split a string by a delimiting character or set of characters, the ActionScript 3.0 split() method is just dandy for doing that. Similar to the PHP explode() function in which it creates an array containing each substring split from the original string. We can then access the full array or indexed segments of it.

In the following example we use split() to separate using comma as a target delimiter(splitter). Anytime a comma is met in the string, that is where it will be split.
Learn HTML
var myString:String = "Jimmy,Susan,Paul,John";

var myArray:Array = myString.split(",");

trace(myArray[0]);
trace(myArray[1]);
trace(myArray[2]);
trace(myArray[3]);

Develop PHP browser display window
Jimmy
Susan
Paul
John


                                   Search, Validate, and Replace Using Regular Expressions


Comment on Split Or Explode Strings




Search Tags:
Split   ·  Or   ·  Explode   ·  Strings   ·  
 
 
Arbitrary Links and Archives
Home
Active Forums
Members
SIte News
Link To Us
Gear
2009 Forum Archive
Programming Courses
Learn HTML
Learn CSS
Learn PHP
Learn MySQL
Learn Javascript
Learn jQuery
Learn ActionScript 3.0
Learn Java
Learn XML
DevelopPHP Requires Flash Player
Get Adobe Flash player
___________________________________________

Terms of Use  •  Privacy  •  Admin Notes

©2010 developphp.com   |   Powered By FlashBuildingHolder