Retrieves a substring from this instance. The substring starts at a specified character position.

Namespace: MonoSoftware.Core
Assembly: MonoSoftware.Core (in MonoSoftware.Core.dll) Version: 1.0.40.669 (1.0.40.669)

Syntax

C#
public static string Substring(
	this StringBuilder sb,
	int startIndex,
	int length
)
Visual Basic
<ExtensionAttribute> 
Public Shared Function Substring ( 
	sb As StringBuilder,
	startIndex As Integer,
	length As Integer
) As String
Visual C++
public:
[ExtensionAttribute]
static String^ Substring(
	StringBuilder^ sb, 
	int startIndex, 
	int length
)
F#
static member Substring : 
        sb : StringBuilder * 
        startIndex : int * 
        length : int -> string 

Parameters

sb
Type: System.Text..::..StringBuilder
String builder instance
startIndex
Type: System..::..Int32
The zero-based starting position of this instance.
length
Type: System..::..Int32
The number of characters in the substring.

Return Value

Type: String
A System.String equivalent to the substring of length length that begins at startIndex in this instance, or System.String.Empty if startIndex is equal to the length of this instance and length is zero.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type StringBuilder. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

See Also