StringSegmentExtensionsReadToWhiteSpace Method

Advances the specified rest parameter after the next whitespace character and returns the consumed part without the whitespace. If the first character of rest was a whitespace before the call, then an empty segment is returned. If the whole StringSegment has been processed, then rest will be StringSegment.Null after returning.

Definition

Namespace: KGySoft.CoreLibraries
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 10.0.0
C#
public static StringSegment ReadToWhiteSpace(
	this ref StringSegment rest
)

Parameters

rest  StringSegment
Represents the rest of the string to process. When this method returns, the value of this parameter will be the remaining unprocessed part, or StringSegment.Null if the whole segment has been processed.

Return Value

StringSegment
A StringSegment that contains the first segment of the original value of the rest parameter delimited by whitespace characters, or the complete original value of rest if it contained no more whitespace characters.

Usage Note

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