C# Class NSlice.StringExtensions

Provides a set of static methods for System.String.
Mostrar archivo Open project: nabuk/NSlice

Public Methods

Method Description
At ( this source, int index ) : char

Returns the character at a specified index in a string. Index can be negative, e.g. '-1' means last, '-2' means one before last and so on.

AtOrDefault ( this source, int index ) : char?

Returns the character at a specified index in a string or null if the index is out of range. Index can be negative, e.g. '-1' means last, '-2' means one before last and so on.

Slice ( this source, int from = null, int to = null, int step = 1 ) : string

Performs slice on passed string.

SliceDelete ( this source, int from = null, int to = null, int step = 1 ) : string

Performs deletion of specified slice.

Method Details

At() public static method

Returns the character at a specified index in a string. Index can be negative, e.g. '-1' means last, '-2' means one before last and so on.
source is null. index is out of source string's range.
public static At ( this source, int index ) : char
source this Source string.
index int Index of character to retrieve.
return char

AtOrDefault() public static method

Returns the character at a specified index in a string or null if the index is out of range. Index can be negative, e.g. '-1' means last, '-2' means one before last and so on.
source is null.
public static AtOrDefault ( this source, int index ) : char?
source this Source string.
index int Index of character to retrieve.
return char?

Slice() public static method

Performs slice on passed string.
source is null. step is equal to 0.
public static Slice ( this source, int from = null, int to = null, int step = 1 ) : string
source this Source string.
from int First character index.
to int Exclusive boundary.
step int Increment index by.
return string

SliceDelete() public static method

Performs deletion of specified slice.
source is null. step is equal to 0.
public static SliceDelete ( this source, int from = null, int to = null, int step = 1 ) : string
source this Source string.
from int First character index to delete.
to int Exclusive boundary.
step int Increment index by.
return string