StringExtensionsAsSegment(String, Int32) Method

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

Definition

Namespace: KGySoft.CoreLibraries
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 7.2.0
C#
public static StringSegment AsSegment(
	this string s,
	int offset
)

Parameters

s  String
The string to create the StringSegment from.
offset  Int32
The offset that points to the first character of the returned segment.

Return Value

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