C# Класс FP.Text.Strings

Provides a set of static (Shared in Visual Basic) methods for strings.
The source of each method includes the Haskell version as a comment at the end. Some methods are not safe to use with mutable collections. These cases are mentioned in the documentation for the method. The order of arguments has generally been inverted compared to the Haskell versions to facilitate method chaining. See also the Remarks for Enumerable.
Показать файл Открыть проект

Открытые методы

Метод Описание
AsString ( this charSequence ) : string

Converts a sequence of chars to a string. This should be called ToString, but this is impossible for the obvious reason.

Clear ( this sb ) : void

Clears the specified StringBuilder. This is equivalent to calling sb.Count = 0.

IsNullOrEmpty ( this s ) : bool

Determines whether the string is null or empty. This is merely string.IsNullOrEmpty(s) as an extension method.

Lines ( this charSequence ) : IEnumerable

Breaks the specified char sequence into a sequence of strings at newline characters. The resulting strings do not contain newlines.

ReverseIterator ( this s ) : IEnumerable

Enumerates the specified string in the reverse order.

UnLines ( this lines ) : IEnumerable

An inverse to Lines. Joins lines, after appending a terminating newline to each.

UnLinesAsString ( this lines ) : string

Equivalent to UnLines().AsString(), but more efficient.

UnLinesCS ( this lines ) : IEnumerable

An inverse to Lines. It joins lines, after appending a terminating newline to each.

UnWords ( this words ) : IEnumerable

An inverse to Words. It joins words, separating them by a single space.

UnWordsAsString ( this words ) : string

Equivalent to UnWords().AsString(), but more efficient.

UnWordsCS ( this words ) : IEnumerable

An inverse to Words. It joins words, separating them by a single space.

Words ( this charSequence ) : IEnumerable

Breaks the specified char sequence into a sequence of words delimited by whitespace. The resulting strings do not contain whitespace.

Описание методов

AsString() публичный статический Метод

Converts a sequence of chars to a string. This should be called ToString, but this is impossible for the obvious reason.
public static AsString ( this charSequence ) : string
charSequence this The char sequence.
Результат string

Clear() публичный статический Метод

Clears the specified StringBuilder. This is equivalent to calling sb.Count = 0.
public static Clear ( this sb ) : void
sb this The .
Результат void

IsNullOrEmpty() публичный статический Метод

Determines whether the string is null or empty. This is merely string.IsNullOrEmpty(s) as an extension method.
public static IsNullOrEmpty ( this s ) : bool
s this
Результат bool

Lines() публичный статический Метод

Breaks the specified char sequence into a sequence of strings at newline characters. The resulting strings do not contain newlines.
public static Lines ( this charSequence ) : IEnumerable
charSequence this The char sequence.
Результат IEnumerable

ReverseIterator() публичный статический Метод

Enumerates the specified string in the reverse order.
public static ReverseIterator ( this s ) : IEnumerable
s this
Результат IEnumerable

UnLines() публичный статический Метод

An inverse to Lines. Joins lines, after appending a terminating newline to each.
public static UnLines ( this lines ) : IEnumerable
lines this A sequence of strings.
Результат IEnumerable

UnLinesAsString() публичный статический Метод

Equivalent to UnLines().AsString(), but more efficient.
public static UnLinesAsString ( this lines ) : string
lines this A sequence of strings.
Результат string

UnLinesCS() публичный статический Метод

An inverse to Lines. It joins lines, after appending a terminating newline to each.
public static UnLinesCS ( this lines ) : IEnumerable
lines this A sequence of sequences of chars.
Результат IEnumerable

UnWords() публичный статический Метод

An inverse to Words. It joins words, separating them by a single space.
public static UnWords ( this words ) : IEnumerable
words this A sequence of strings.
Результат IEnumerable

UnWordsAsString() публичный статический Метод

Equivalent to UnWords().AsString(), but more efficient.
public static UnWordsAsString ( this words ) : string
words this A sequence of strings.
Результат string

UnWordsCS() публичный статический Метод

An inverse to Words. It joins words, separating them by a single space.
public static UnWordsCS ( this words ) : IEnumerable
words this A sequence of sequences of chars.
Результат IEnumerable

Words() публичный статический Метод

Breaks the specified char sequence into a sequence of words delimited by whitespace. The resulting strings do not contain whitespace.
public static Words ( this charSequence ) : IEnumerable
charSequence this The char sequence.
Результат IEnumerable