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
source
stringSource string.
startIndex
intIndex of the first character that should be included in the segment.
Returns
- StringSegment
New StringSegment instance.
Exceptions
- ArgumentOutOfRangeException
When
startIndex
is 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
source
stringSource string.
startIndex
intIndex of the first character that should be included in the segment.
length
intLength of the segment.
Returns
- StringSegment
New StringSegment instance.
Exceptions
- ArgumentOutOfRangeException
When
startIndex
is less than 0 or whenlength
is less than 0.
Reverse(string)
Reverses the given string.
[Pure]
public static string Reverse(this string source)
Parameters
source
stringSource string.