Fengzhimei@Dot.Net
Designing My Colorful Dream
function StringBuilder() {
    
this.buffer = new Array();
}


StringBuilder.prototype.Append 
= function Append(string) {
    
if ((string ==null|| (typeof(string)=='undefined'))
        
return;
    
if ((typeof(string)=='string') && (string.length == 0))
        
return;
    
this.buffer.push(string);
}
;

StringBuilder.prototype.AppendLine 
= function AppendLine(string) {
    
this.Append(string);
    
this.buffer.push("\r\n");
}
;

StringBuilder.prototype.Clear 
= function Clear() {
    
if (this.buffer.length >0 ){
        
this.buffer.splice(0,this.buffer.length);
    }

}


StringBuilder.prototype.IsEmpty 
= function IsEmpty() {
    
return (this.buffer.length == 0);
}


StringBuilder.prototype.ToString 
= function ToString() {
    
return this.buffer.join("");
}
;
posted on 2006-05-16 23:39  fengzhimei  阅读(968)  评论(1编辑  收藏  举报