Class StringExtensions
- Namespace
- LfrlAnvil.Extensions
- Assembly
- LfrlAnvil.Core.dll
Contains string extension methods.
public static class StringExtensions
- Inheritance
-
StringExtensions
- Inherited Members
Methods
AsSegment(string, int)
Creates a new StringSegment instance from the given string and startIndex.
[Pure]
public static StringSegment AsSegment(this string source, int startIndex)
Parameters
sourcestringSource string.
startIndexintIndex of the first character that should be included in the segment.
Returns
- StringSegment
New StringSegment instance.
Exceptions
- ArgumentOutOfRangeException
When
startIndexis less than 0.
AsSegment(string, int, int)
Creates a new StringSegment instance from the given string,
startIndex and length.
[Pure]
public static StringSegment AsSegment(this string source, int startIndex, int length)
Parameters
sourcestringSource string.
startIndexintIndex of the first character that should be included in the segment.
lengthintLength of the segment.
Returns
- StringSegment
New StringSegment instance.
Exceptions
- ArgumentOutOfRangeException
When
startIndexis less than 0 or whenlengthis less than 0.
Reverse(string)
Reverses the given string.
[Pure]
public static string Reverse(this string source)
Parameters
sourcestringSource string.