NET Framework counterpart (System.Text.StringBuilder) in that they both
share similar method signatures for many of the methods. This class can also take in the
initial string as its constructor. All methods are instance based and thus require an
CHAPTER 4 ?– ASP.NET AJAX CLIENT LIBRARIES 78
instance object to be executed. Table 4-20 lists the methods of the Sys.StringBuilder
class.
Table 4-20.Methods of the Sys.StringBuilder Class
Method Name Description
append Appends a string to the end of the StringBuilder object
appendLine Appends a new string with a line feed at the end of the StringBuilder
instance
clear Clears the contents of the StringBuilder object
isEmpty Boolean value indicating whether or not the StringBuilder object has
any content
toString Returns a string from the contents of a StringBuilder instance
To see the Sys.StringBuilder class in action, take a look at the following function:
function stringBuilderSample()
{
var sb = new Sys.StringBuilder("");
sb.appendLine('');
sb.appendLine('');
sb.appendLine('