Simply awesomeThe #1 ASP/ASP.NET Developer Community

StringBuilder.Length Property

System.Text Namespace   StringBuilder Class


Sets or retrieves the length of this instance.

[ VB ]
<Serializable>
Public Property Length As Integer

[ C# ]
[Serializable]
public int Length {get; set;}

[ C++ ]
[Serializable]
public: __property int get_Length ( );
public: __property void set_Length ( int );

[ JScript ]
public Serializable
function get Length ( ) : int;
public function set Length ( int );

Property Value

The length of this instance.

Exceptions


Exception Type Condition
ArgumentOutOfRangeException The value specified for a set operation is less than zero or greater than MaxValue.

Remarks

If the specified length is less than the current length, this instance is truncated to the specified length. If the specified length is greater than the current length, the end of the string value of this instance is padded with spaces. If the specified length is greater than the current capacity, Capacity is set to the specified length.

See Also

StringBuilder Members


Previous page Back to top Next page

Check out related books at Amazon

© 2025 Reynald Nuñez and asp.net.ph. All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note