StringSegmentExtensionsRead Method
Advances the specified
rest parameter consuming up to
maxLength characters and returns
the consumed part. 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.CoreLibrariesAssembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 8.1.0
public static StringSegment Read(
this ref StringSegment rest,
int maxLength
)
<ExtensionAttribute>
Public Shared Function Read (
ByRef rest As StringSegment,
maxLength As Integer
) As StringSegment
public:
[ExtensionAttribute]
static StringSegment Read(
StringSegment% rest,
int maxLength
)
[<ExtensionAttribute>]
static member Read :
rest : StringSegment byref *
maxLength : int -> StringSegment
- 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.
- maxLength Int32
- The maximum number of characters to read.
StringSegmentA
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 than
maxLength characters.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).