StringBuilder belongs to namespace Sys.
it can be instantiated like this
var sb = new Sys.StringBuilder(string);Methods of StringBuilder Class
append Method
Appends a string to the end of the StringBuilder instance.
appendLine Method
Appends a new string with a line terminator to the end of the StringBuilder instance.
clear Method
Clears the contents of the StringBuilder instance.
isEmpty Method
Determines whether the StringBuilder instance has any content.
toString Method
Creates a string from the contents of a StringBuilder instance.
Example
var sb = new Sys.StringBuilder("this");
sb.append("string ");
sb.append("is ");
sb.append("build by ");
sb.append("String Builder class");
// Displays: "The result string : this string is build by String BUilder class"
alert("The result" + sb.toString());
No comments:
Post a Comment