Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Gets or sets the length of the current StringBuilder object.
Namespace: System.Text
Assembly: mscorlib (in mscorlib.dll)
Syntax
'Declaration
Public Property Length As Integer
public int Length { get; set; }
public:
property int Length {
int get ();
void set (int value);
}
member Length : int with get, set
function get Length () : int
function set Length (value : int)
Property Value
Type: System. . :: . .Int32
The length of this instance.
Remarks
Like the String..::..Length property, the Length property indicates the length of the current string object. Unlike the String..::..Length property, which is read-only, the Length property allows you to modify the length of the string stored to the StringBuilder object.
If the specified length is less than the current length, the current StringBuilder object is truncated to the specified length. If the specified length is greater than the current length, the end of the string value of the current StringBuilder object is padded with the Unicode NULL character (U+0000).
If the specified length is greater than the current capacity, Capacity increases so that it is greater than or equal to the specified length.
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see dd66cd4c-b087-415f-9c3e-94e3a1835f74.