.NET Framework Class Library
StringBuilder..::.Append Method (Int32)
Updated: December 2010
Appends the string representation of a specified 32-bit signed integer to this instance.
Namespace:
System.Text
Assembly:
mscorlib (in mscorlib.dll)

Syntax
Public Function Append ( _
value As Integer _
) As StringBuilder
public StringBuilder Append(
int value
)
public:
StringBuilder^ Append(
int value
)
member Append :
value:int -> StringBuilder

Exceptions

Remarks
The Append method modifies the existing instance of this class; it does not return a new class instance. Because of this, you can call a method or property on the existing reference and you do not have to assign the return value to a StringBuilder object, as the following example illustrates.
Dim sb As New System.Text.StringBuilder("The range of a 32-bit integer: ")
sb.Append(Int32.MinValue).Append(" to ").Append(Int32.MaxValue)
Console.WriteLine(sb)
' The example displays the following output:
' The range of a 32-bit integer: -2147483648 to 2147483647
System.Text.StringBuilder sb = new
System.Text.StringBuilder("The range of a 32-bit integer: ");
sb.Append(Int32.MinValue).Append(" to ").Append(Int32.MaxValue);
Console.WriteLine(sb);
// The example displays the following output:
// The range of a 32-bit integer: -2147483648 to 2147483647
The Append method calls the Int32..::.ToString(IFormatProvider) method to get the string representation of value for the current culture. To control the formatting of value, call the AppendFormat method.
The capacity of this instance is adjusted as needed.

Version Information
.NET Framework
Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0
.NET Framework Client Profile
Supported in: 4, 3.5 SP1
Portable Class Library
Supported in: Portable Class Library

Platforms
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role not supported), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

See Also

Change History
Date | History | Reason |
|---|
December 2010
| Expanded the Remarks section and removed the example. |
Customer feedback.
|