C# Класс Loyc.StringBuilderExt

Extension methods that add some functionality of string to StringBuilder.
Показать файл Открыть проект

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

Метод Описание
AppendCodePoint ( this s, int c ) : StringBuilder

Appends a unicode code point in the range 0 to 0x10FFFF to StringBuilder in UTF-16.

EndsWith ( this sb, UString what, bool ignoreCase = false ) : bool

Finds out whether the StringBuilder ends with the specified substring.

IndexOf ( this sb, UString searchStr, int startIndex, bool ignoreCase = false ) : int

Gets the index of a substring in a StringBuilder

IndexOf ( this sb, char value, int startIndex ) : int

Gets the index of a character in a StringBuilder

Last ( this str ) : char

Returns the last character of the string

LastIndexOf ( this sb, UString searchStr, int startIndex = int.MaxValue, bool ignoreCase = false ) : int

Gets the index of a substring in a StringBuilder

LastIndexOf ( this sb, char searchChar, int startIndex = int.MaxValue ) : int

Gets the index of a character in a StringBuilder

LastOrDefault ( this str, char @default = '\0' ) : char

Returns the last character of the string, or a default character if the string is empty.

StartsWith ( this sb, UString what, bool ignoreCase = false ) : bool

Finds out whether the StringBuilder starts with the specified substring.

Substring ( this sb, int startIndex, int length ) : string

Extracts a substring from the specified StringBuiler.

SubstringEquals ( StringBuilder sb, int start, UString what, bool ignoreCase = false ) : bool

Checks if the sequences of characters what is equal to sb.Substring(start, what.Length), without actually creating a substring object.

Trim ( this sb ) : StringBuilder

Removes all leading and trailing occurrences of spaces and tabs from the StringBuilder object.

TrimEnd ( this sb ) : StringBuilder

Removes all trailing occurrences of spaces and tabs from the StringBuilder object.

TrimStart ( this sb ) : StringBuilder

Removes all leading occurrences of spaces and tabs from the StringBuilder object.

TryGet ( this s, int index, char defaultValue ) : char
TryGet ( this s, int index ) : char?

Приватные методы

Метод Описание
SubstringEqualHelper ( StringBuilder sb, int start, UString what, bool ignoreCase = false ) : bool

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

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

Appends a unicode code point in the range 0 to 0x10FFFF to StringBuilder in UTF-16.
Invalid character c null StringBuildre
public static AppendCodePoint ( this s, int c ) : StringBuilder
s this
c int
Результат StringBuilder

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

Finds out whether the StringBuilder ends with the specified substring.
public static EndsWith ( this sb, UString what, bool ignoreCase = false ) : bool
sb this
what UString
ignoreCase bool
Результат bool

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

Gets the index of a substring in a StringBuilder
public static IndexOf ( this sb, UString searchStr, int startIndex, bool ignoreCase = false ) : int
sb this
searchStr UString
startIndex int
ignoreCase bool
Результат int

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

Gets the index of a character in a StringBuilder
public static IndexOf ( this sb, char value, int startIndex ) : int
sb this
value char
startIndex int
Результат int

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

Returns the last character of the string
public static Last ( this str ) : char
str this
Результат char

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

Gets the index of a substring in a StringBuilder
public static LastIndexOf ( this sb, UString searchStr, int startIndex = int.MaxValue, bool ignoreCase = false ) : int
sb this
searchStr UString
startIndex int
ignoreCase bool
Результат int

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

Gets the index of a character in a StringBuilder
public static LastIndexOf ( this sb, char searchChar, int startIndex = int.MaxValue ) : int
sb this
searchChar char
startIndex int
Результат int

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

Returns the last character of the string, or a default character if the string is empty.
public static LastOrDefault ( this str, char @default = '\0' ) : char
str this
@default char
Результат char

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

Finds out whether the StringBuilder starts with the specified substring.
public static StartsWith ( this sb, UString what, bool ignoreCase = false ) : bool
sb this
what UString
ignoreCase bool
Результат bool

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

Extracts a substring from the specified StringBuiler.
public static Substring ( this sb, int startIndex, int length ) : string
sb this
startIndex int
length int
Результат string

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

Checks if the sequences of characters what is equal to sb.Substring(start, what.Length), without actually creating a substring object.
public static SubstringEquals ( StringBuilder sb, int start, UString what, bool ignoreCase = false ) : bool
sb StringBuilder
start int
what UString
ignoreCase bool
Результат bool

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

Removes all leading and trailing occurrences of spaces and tabs from the StringBuilder object.
public static Trim ( this sb ) : StringBuilder
sb this
Результат StringBuilder

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

Removes all trailing occurrences of spaces and tabs from the StringBuilder object.
public static TrimEnd ( this sb ) : StringBuilder
sb this
Результат StringBuilder

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

Removes all leading occurrences of spaces and tabs from the StringBuilder object.
public static TrimStart ( this sb ) : StringBuilder
sb this
Результат StringBuilder

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

public static TryGet ( this s, int index, char defaultValue ) : char
s this
index int
defaultValue char
Результат char

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

public static TryGet ( this s, int index ) : char?
s this
index int
Результат char?