Converting Arrays to Lists : join « Array « Flash / Flex / ActionScript






Converting Arrays to Lists

 

package{
  import flash.display.Sprite;
  
  public class Main extends Sprite{
    public function Main(){

        var aEmployees:Array = ["A", "P", "C", "H"];
        var sEmployees:String = aEmployees.join(",");
        trace(sEmployees);

    }
  }
}
//A,P,C,H

        








Related examples in the same category

1.With join() you can use any delimiter you want
2.Converting an Array to a String: Use the join( ) method.
3.Without a delimiter, Flash uses a comma by default
4.Use an array in a situation in which a string is required, Flash automatically calls the toString( ) method
5.Join object array