Table of Contents

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 string

Source string.

startIndex int

Index 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 string

Source string.

startIndex int

Index of the first character that should be included in the segment.

length int

Length of the segment.

Returns

StringSegment

New StringSegment instance.

Exceptions

ArgumentOutOfRangeException

When startIndex is less than 0 or when length is less than 0.

Reverse(string)

Reverses the given string.

[Pure]
public static string Reverse(this string source)

Parameters

source string

Source string.

Returns

string

New string instance that represents reversed source string.