C# Class Loyc.StringBuilderExt

Extension methods that add some functionality of string to StringBuilder.
Afficher le fichier Open project: qwertie/ecsharp

Méthodes publiques

Méthode Description
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?

Private Methods

Méthode Description
SubstringEqualHelper ( StringBuilder sb, int start, UString what, bool ignoreCase = false ) : bool

Method Details

AppendCodePoint() public static méthode

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
Résultat StringBuilder

EndsWith() public static méthode

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
Résultat bool

IndexOf() public static méthode

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
Résultat int

IndexOf() public static méthode

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
Résultat int

Last() public static méthode

Returns the last character of the string
public static Last ( this str ) : char
str this
Résultat char

LastIndexOf() public static méthode

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
Résultat int

LastIndexOf() public static méthode

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
Résultat int

LastOrDefault() public static méthode

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
Résultat char

StartsWith() public static méthode

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
Résultat bool

Substring() public static méthode

Extracts a substring from the specified StringBuiler.
public static Substring ( this sb, int startIndex, int length ) : string
sb this
startIndex int
length int
Résultat string

SubstringEquals() public static méthode

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
Résultat bool

Trim() public static méthode

Removes all leading and trailing occurrences of spaces and tabs from the StringBuilder object.
public static Trim ( this sb ) : StringBuilder
sb this
Résultat StringBuilder

TrimEnd() public static méthode

Removes all trailing occurrences of spaces and tabs from the StringBuilder object.
public static TrimEnd ( this sb ) : StringBuilder
sb this
Résultat StringBuilder

TrimStart() public static méthode

Removes all leading occurrences of spaces and tabs from the StringBuilder object.
public static TrimStart ( this sb ) : StringBuilder
sb this
Résultat StringBuilder

TryGet() public static méthode

public static TryGet ( this s, int index, char defaultValue ) : char
s this
index int
defaultValue char
Résultat char

TryGet() public static méthode

public static TryGet ( this s, int index ) : char?
s this
index int
Résultat char?