KGy SOFT

StringExtensionsAsSegment Method (String, Int32, Int32)

KGy SOFT Core Libraries Help
Gets a StringSegment instance, which represents a segment of the specified string. No new string allocation occurs when using this method.

Namespace:  KGySoft.CoreLibraries
Assembly:  KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 5.3.0
Syntax

public static StringSegment AsSegment(
	this string s,
	int offset,
	int length
)

Parameters

s
Type: SystemString
The string to create the StringSegment from.
offset
Type: SystemInt32
The offset that points to the first character of the returned segment.
length
Type: SystemInt32
The desired length of the returned segment.

Return Value

Type: StringSegment
A StringSegment instance, which represents a segment of the specified string.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type String. 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

Reference