C# Class Cimbalino.Phone.Toolkit.Extensions.StringExtensions

Provides a set of static (Shared in Visual Basic) methods for string instances
Show file Open project: Cimbalino/Cimbalino-Phone-Toolkit

Public Methods

Method Description
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.

Method Details

FormatWith() public static method

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.
return string

FormatWith() public static method

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.
return string

FormatWithInvariantCulture() public static method

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.
return string

FromBase64String() public static method

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.
return byte[]

GetBytes() public static method

Encodes all the characters in the string into a sequence of UTF8 bytes.
public static GetBytes ( this input ) : byte[]
input this The current string.
return byte[]

GetBytes() public static method

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.
return byte[]

Left() public static method

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.
return string

RegexIsMatch() public static method

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.
return bool

RegexIsMatch() public static method

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.
return bool

RegexMatch() public static method

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.
return Match

RegexMatch() public static method

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.
return Match

RegexMatches() public static method

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.
return MatchCollection

RegexMatches() public static method

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.
return MatchCollection

RegexReplace() public static method

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.
return string

RegexReplace() public static method

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.
return string

RegexReplace() public static method

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.
return string

RegexReplace() public static method

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.
return string

RemoveLeft() public static method

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.
return string

RemoveRight() public static method

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.
return string

Right() public static method

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.
return string

Times() public static method

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.
return string