StringSegmentExtensions Class

Provides extension methods for the StringSegment type.

Definition

Namespace: KGySoft.CoreLibraries
Assembly: KGySoft.CoreLibraries (in KGySoft.CoreLibraries.dll) Version: 7.0.0
C#
public static class StringSegmentExtensions
Inheritance
Object    StringSegmentExtensions

Methods

Read 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.
ReadLine 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.
ReadToSeparator(StringSegment, StringSegment) Advances the specified rest parameter after the next separator and returns the consumed part without the separator. If rest started with separator before the call, then an empty segment is returned. If the whole StringSegment has been processed, then rest will be StringSegment.Null after returning.
ReadToSeparator(StringSegment, StringSegment) Advances the specified rest parameter after the next separator and returns the consumed part without the separator. If rest started with one of the separators before the call, then an empty segment is returned. If the whole StringSegment has been processed, then rest will be StringSegment.Null after returning.
ReadToSeparator(StringSegment, Char) Advances the specified rest parameter after the next separator character and returns the consumed part without the separator. If the first character of rest was a separator before the call, then an empty segment is returned. If the whole StringSegment has been processed, then rest will be StringSegment.Null after returning.
ReadToSeparator(StringSegment, Char) Advances the specified rest parameter after the next separator and returns the consumed part without the separator. If rest started with one of the separators before the call, then an empty segment is returned. If the whole StringSegment has been processed, then rest will be StringSegment.Null after returning.
ReadToSeparator(StringSegment, ReadOnlySpanChar) Advances the specified rest parameter after the next separator and returns the consumed part without the separator. If rest started with separator before the call, then an empty segment is returned. If the whole StringSegment has been processed, then rest will be StringSegment.Null after returning.
ReadToSeparator(StringSegment, String) Advances the specified rest parameter after the next separator and returns the consumed part without the separator. If rest started with separator before the call, then an empty segment is returned. If the whole StringSegment has been processed, then rest will be StringSegment.Null after returning.
ReadToSeparator(StringSegment, String) Advances the specified rest parameter after the next separator and returns the consumed part without the separator. If rest started with one of the separators before the call, then an empty segment is returned. If the whole StringSegment has been processed, then rest will be StringSegment.Null after returning.
ReadToWhiteSpace 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.
RemoveQuotes Extracts content of a single or double quoted string.
ToEnumTEnum Tries to convert the specified StringSegment to an Enum value of TEnum type. No string allocation occurs when using this method.

See Also