      */
     public static function substitute (str :String, ... args) :String
     {
-        // holy christ the varargs insanity
+        // if someone passed an array as arg 1, fix it
         args = Util.unfuckVarargs(args);
-        args.unshift(str);
-        return mx.utils.StringUtil.substitute.apply(null, args);
+        var len :int = args.length;
+        // TODO: FIXME: this might be wrong, if your {0} replacement has a {1} in it, then
+        // that'll get replaced next iteration.
+        for (var ii : int = 0; ii < len; ii++) {
+            str = str.replace(new RegExp("\\{" + ii + "\\}", "g"), args[ii]);
+        }
+        return str;
     }
 
     /**

     */
    public static function trim (str :String) :String
    {
        return mx.utils.StringUtil.trim(str);
    }

    public static function toString (obj :*) :String


import flash.utils.describeType; // function import

public class StringUtil
{
    /**
