Array: Sort an array of strings

Sort an array of strings:

arrayOfStrings.sort( function(a:String, b:String):Int
{
    a = a.toLowerCase();
    b = b.toLowerCase();
    if (a < b) return -1;
    if (a > b) return 1;
    return 0;
} );

Alternative using reflection:
arrayOfStrings.sort(function(a,b) return Reflect.compare(a.toLowerCase(), b.toLowerCase()) );

version #15256, modified 2012-08-03 09:39:47 by theRemix