KGy SOFT

StringSegmentExtensionsReadLine Method

KGy SOFT Core Libraries Help
Advances the specified rest parameter after the current line and returns the consumed part without the newline character(s). If rest started with a new line before the call, then an empty segment is returned. If the whole StringSegment has been processed, then rest will be StringSegment.Null after returning.

Namespace:  KGySoft.CoreLibraries
Assembly:  KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 5.5.0-rc.1
Syntax

public static StringSegment ReadLine(
	this ref StringSegment rest
)

Parameters

rest
Type: KGySoft.CoreLibrariesStringSegment
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

Type: StringSegment
A StringSegment that contains the first line of the original value of the rest parameter, or the complete original value of rest if it contained no more lines.

Usage Note

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

The effect of this method is the same as calling the ReadToSeparator(StringSegment, String) method with "\r\n", "\r", "\n" parameters but it is implemented a bit more optimized way.

See Also

Reference