From ff674f818f76e322293986a33637d3024128d4d7 Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Tue, 9 May 2006 23:01:15 +0000 Subject: [PATCH] Beta 3 is out! They removed the built-in StringBuilder class, so I made my own for now that just does what I need it to. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4103 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/as/com/threerings/util/StringBuilder.as | 33 +++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/as/com/threerings/util/StringBuilder.as diff --git a/src/as/com/threerings/util/StringBuilder.as b/src/as/com/threerings/util/StringBuilder.as new file mode 100644 index 000000000..820cbe4d0 --- /dev/null +++ b/src/as/com/threerings/util/StringBuilder.as @@ -0,0 +1,33 @@ +package com.threerings.util { + +public class StringBuilder +{ + public function StringBuilder (... args) + { + _array = args; + } + + /** + * Append all arguments to the end of the string being built + * and return this StringBuilder. + */ + public function append (... args) :StringBuilder + { + while (args.length > 0) { + _array.push(args.shift()); + } + return this; + } + + /** + * Return the String built so far. + */ + public function toString () :String + { + return _array.join(""); + } + + /** Our array in which we place all arguments. */ + protected var _array :Array; +} +}