C# Класс Cimbalino.Phone.Toolkit.Extensions.StringExtensions

Provides a set of static (Shared in Visual Basic) methods for string instances
Показать файл Открыть проект

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

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

Replaces one or more format items in the string with the string representation of a specified object.

FormatWith ( this format, IFormatProvider provider ) : string

Replaces one or more format items in the string with the string representation of a specified object.

FormatWithInvariantCulture ( this format ) : string

Replaces one or more format items in the string with the string representation of a specified object, using an CultureInfo.InvariantCulture.

FromBase64String ( this input ) : byte[]

Converts the string, which encodes binary data as base-64 digits, to an equivalent 8-bit unsigned integer array.

GetBytes ( this input ) : byte[]

Encodes all the characters in the string into a sequence of UTF8 bytes.

GetBytes ( this input, Encoding encoding ) : byte[]

Encodes all the characters in the string into a sequence of bytes, using the specified Encoding.

Left ( this input, int length ) : string

Returns a new string containing the specified number of characters from the left side of the current string.

RegexIsMatch ( this input, string pattern ) : bool

Indicates whether the regular expression finds a match in the input string using the regular expression specified in the pattern parameter.

RegexIsMatch ( this input, string pattern, RegexOptions options ) : bool

Indicates whether the regular expression finds a match in the input string, using the regular expression specified in the pattern parameter and the matching options supplied in the options parameter.

RegexMatch ( this input, string pattern ) : Match

Searches the specified input string for the first occurrence of the regular expression supplied in the pattern parameter.

RegexMatch ( this input, string pattern, RegexOptions options ) : Match

Searches the input string for the first occurrence of the regular expression supplied in a pattern parameter with matching options supplied in an options parameter.

RegexMatches ( this input, string pattern ) : MatchCollection

Searches the specified input string for all occurrences of the regular expression specified in the pattern parameter.

RegexMatches ( this input, string pattern, RegexOptions options ) : MatchCollection

Searches the specified input string for all occurrences of the regular expression supplied in a pattern parameter with matching options supplied in an options parameter.

RegexReplace ( this input, string pattern, MatchEvaluator evaluator ) : string

Within a specified input string, replaces all strings that match a specified regular expression with a string returned by a MatchEvaluator delegate.

RegexReplace ( this input, string pattern, MatchEvaluator evaluator, RegexOptions options ) : string

Within a specified input string, replaces all strings that match a specified regular expression with a string returned by a MatchEvaluator delegate. Specified options modify the matching operation.

RegexReplace ( this input, string pattern, string replacement ) : string

Within a specified input string, replaces all strings that match a specified regular expression with a specified replacement string.

RegexReplace ( this input, string pattern, string replacement, RegexOptions options ) : string

Within a specified input string, replaces all strings that match a specified regular expression with a specified replacement string. Specified options modify the matching operation.

RemoveLeft ( this input, int length ) : string

Returns a new string in which a specified number of characters from the left side of the current string are deleted.

RemoveRight ( this input, int length ) : string

Returns a new string in which a specified number of characters from the right side of the current string are deleted.

Right ( this input, int length ) : string

Returns a new string containing the specified number of characters from the right side of the current string.

Times ( this input, int count ) : string

Returns a new string by repeating the current string the specified number of times.

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

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

Replaces one or more format items in the string with the string representation of a specified object.
public static FormatWith ( this format ) : string
format this The composite format string.
Результат string

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

Replaces one or more format items in the string with the string representation of a specified object.
public static FormatWith ( this format, IFormatProvider provider ) : string
format this The composite format string.
provider IFormatProvider An object that supplies culture-specific formatting information.
Результат string

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

Replaces one or more format items in the string with the string representation of a specified object, using an CultureInfo.InvariantCulture.
public static FormatWithInvariantCulture ( this format ) : string
format this The composite format string.
Результат string

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

Converts the string, which encodes binary data as base-64 digits, to an equivalent 8-bit unsigned integer array.
public static FromBase64String ( this input ) : byte[]
input this The current string.
Результат byte[]

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

Encodes all the characters in the string into a sequence of UTF8 bytes.
public static GetBytes ( this input ) : byte[]
input this The current string.
Результат byte[]

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

Encodes all the characters in the string into a sequence of bytes, using the specified Encoding.
public static GetBytes ( this input, Encoding encoding ) : byte[]
input this The current string.
encoding System.Text.Encoding The to use for encoding the characters.
Результат byte[]

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

Returns a new string containing the specified number of characters from the left side of the current string.
public static Left ( this input, int length ) : string
input this The current string.
length int The number of characters to return. If 0, a zero-length string ("") is returned. If greater than or equal to the number of characters in the string, the entire string is returned.
Результат string

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

Indicates whether the regular expression finds a match in the input string using the regular expression specified in the pattern parameter.
public static RegexIsMatch ( this input, string pattern ) : bool
input this The string to search for a match.
pattern string The regular expression pattern to match.
Результат bool

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

Indicates whether the regular expression finds a match in the input string, using the regular expression specified in the pattern parameter and the matching options supplied in the options parameter.
public static RegexIsMatch ( this input, string pattern, RegexOptions options ) : bool
input this The string to search for a match.
pattern string The regular expression pattern to match.
options RegexOptions A bitwise combination of the enumeration values.
Результат bool

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

Searches the specified input string for the first occurrence of the regular expression supplied in the pattern parameter.
public static RegexMatch ( this input, string pattern ) : Match
input this The string to be tested for a match.
pattern string The regular expression pattern to match.
Результат Match

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

Searches the input string for the first occurrence of the regular expression supplied in a pattern parameter with matching options supplied in an options parameter.
public static RegexMatch ( this input, string pattern, RegexOptions options ) : Match
input this The string to be tested for a match.
pattern string The regular expression pattern to match.
options RegexOptions A bitwise combination of the enumeration values.
Результат Match

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

Searches the specified input string for all occurrences of the regular expression specified in the pattern parameter.
public static RegexMatches ( this input, string pattern ) : MatchCollection
input this The string to search for a match.
pattern string The regular expression pattern to match.
Результат MatchCollection

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

Searches the specified input string for all occurrences of the regular expression supplied in a pattern parameter with matching options supplied in an options parameter.
public static RegexMatches ( this input, string pattern, RegexOptions options ) : MatchCollection
input this The string to search for a match.
pattern string The regular expression pattern to match.
options RegexOptions A bitwise combination of the enumeration values.
Результат MatchCollection

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

Within a specified input string, replaces all strings that match a specified regular expression with a string returned by a MatchEvaluator delegate.
public static RegexReplace ( this input, string pattern, MatchEvaluator evaluator ) : string
input this The string to search for a match.
pattern string The regular expression pattern to match.
evaluator MatchEvaluator A custom method that examines each match and returns either the original matched string or a replacement string.
Результат string

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

Within a specified input string, replaces all strings that match a specified regular expression with a string returned by a MatchEvaluator delegate. Specified options modify the matching operation.
public static RegexReplace ( this input, string pattern, MatchEvaluator evaluator, RegexOptions options ) : string
input this The string to search for a match.
pattern string The regular expression pattern to match.
evaluator MatchEvaluator A custom method that examines each match and returns either the original matched string or a replacement string.
options RegexOptions A bitwise combination of the enumeration values.
Результат string

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

Within a specified input string, replaces all strings that match a specified regular expression with a specified replacement string.
public static RegexReplace ( this input, string pattern, string replacement ) : string
input this The string to search for a match.
pattern string The regular expression pattern to match.
replacement string The replacement string.
Результат string

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

Within a specified input string, replaces all strings that match a specified regular expression with a specified replacement string. Specified options modify the matching operation.
public static RegexReplace ( this input, string pattern, string replacement, RegexOptions options ) : string
input this The string to search for a match.
pattern string The regular expression pattern to match.
replacement string The replacement string.
options RegexOptions A bitwise combination of the enumeration values.
Результат string

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

Returns a new string in which a specified number of characters from the left side of the current string are deleted.
public static RemoveLeft ( this input, int length ) : string
input this The current string.
length int The number of characters to remove. If greater than or equal to the number of characters in the string, an empty string is returned.
Результат string

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

Returns a new string in which a specified number of characters from the right side of the current string are deleted.
public static RemoveRight ( this input, int length ) : string
input this The current string.
length int The number of characters to remove. If greater than or equal to the number of characters in the string, an empty string is returned.
Результат string

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

Returns a new string containing the specified number of characters from the right side of the current string.
public static Right ( this input, int length ) : string
input this The current string.
length int The number of characters to return. If 0, a zero-length string ("") is returned. If greater than or equal to the number of characters in the string, the entire string is returned.
Результат string

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

Returns a new string by repeating the current string the specified number of times.
public static Times ( this input, int count ) : string
input this The current string.
count int The number of times the current string occurs.
Результат string