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
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user