jan_flanders

Untitled

Jun 16th, 2012
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import flash.display.MovieClip;
  2.  
  3. class Main extends MovieClip
  4. {
  5.     public static function main()
  6.     {
  7.         var arr = ["john", "peter", "tom"];
  8.         trace(Lambda.filter(arr, function (obj:String) return obj.indexOf("o")!=-1));
  9.         trace(Lambda.filter(arr, test));
  10.     }
  11.     inline static function test(obj:String):Bool
  12.     {
  13.         return obj.indexOf("o")!=-1;
  14.     }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment