var StringBuilder = function(){ 
    this.buffer = new Array();  
} 


//¼ø¼­´ë·Î ¹®ÀÚ¿­À» Ãß°¡ÇÑ´Ù.
StringBuilder.prototype.Append = function( strValue ) { 
        this.buffer[this.buffer.length] = strValue;
       // this.buffer.push( strValue ); //IE5.5 NS4
} 


// ¹®ÀÚ¿­ÀÇ Çü½ÄÀ» ÁöÁ¤ÇØ¼­ Ãß°¡ÇÑ´Ù. 
StringBuilder.prototype.AppendFormat = function()
{ 
    var count = arguments.length;
    if( count < 2 ) return ""; 
    var strValue = arguments[0];
    for(var i=1; i<count; i++) 
          strValue = strValue.replace("{"+ (i-1) + "}", arguments[i] );
    this.buffer[this.buffer.length] = strValue;
} 


// ÇØ´çÇÏ´Â À§Ä¡¿¡ ¹®ÀÚ¿­À» Ãß°¡ÇÑ´Ù. (¹®ÀÚÀ§Ä¡°¡ ¾Æ´Ô);
StringBuilder.prototype.Insert = function( idx, strValue ) { 
    this.buffer.splice( idx, 0, strValue );     //IE5.5 NS4 
}


// ÇØ´ç¹®ÀÚ¿­À» »õ·Î¿î ¹®ÀÚ¿­·Î ¹Ù²Û´Ù. 
// (¹è¿­¹æ ´ÜÀ§·Î ¹Ù²Ù¹Ç·Î ¹è¿­¹æ »çÀÌ¿¡ ³¤ ¹®ÀÚ¿­Àº ¹Ù²ÙÁö ¾ÊÀ½)
StringBuilder.prototype.Replace = function( from, to ) { 
    for( var i=this.buffer.length-1; i>=0; i--)
        this.buffer[i] = this.buffer[i].replace(new RegExp(from, "g"), to); //IE4  NS3 
}


// ¹®ÀÚ¿­·Î ¹ÝÈ¯ÇÑ´Ù.
StringBuilder.prototype.ToString = function() { 
        return this.buffer.join("");   //IE4 NS3
} 
