C# Class DevUtils.PrimitivesExtensions.StringExtensions

Static string extensions
ファイルを表示 Open project: jornfilho/.net-Dev-Utils

Public Methods

Method Description
CompareNoCase ( this valueCurrent, string valueToCompare ) : bool

Compares two string objects ignoring case.

ContainedIn ( this valueCurrent, List values ) : bool

Determines if the current string is contained in the specified list of objects.

ContainedIn ( this valueCurrent, List values ) : bool

Determines if the current string is contained in the specified list of strings.

ContainedIn ( this valueCurrent, object values ) : bool

Determines if the current string is contained in the specified array of objects.

EndsWithCurrent ( this valueCurrent, string valueToCompare ) : bool

Gets a value indicating if the string ends with the specified substring for the current culture.

EndsWithOrdinalIgnoreCase ( this valueCurrent, string valueToCompare ) : bool

Gets a value indicating if the string ends with the specified substring for ordinal ignoring case.

FormatCurrent ( this format ) : string

Formats the string with the specified objects for the current culture.

FormatCurrent ( this format, object arg0 ) : string

Formats the string with the specified object for the current culture.

FormatCurrent ( this format, object arg0, object arg1 ) : string

Formats the string with the specified objects for the current culture.

FormatCurrent ( this format, object arg0, object arg1, object arg2 ) : string

Formats the string with the specified objects for the current culture.

FormatInvariant ( this format ) : string

Formats the string with the specified objects for an invariant culture.

FormatInvariant ( this format, object arg0 ) : string

Formats the string with the specified object for an invariant culture.

FormatInvariant ( this format, object arg0, object arg1 ) : string

Formats the string with the specified objects for an invariant culture.

FormatInvariant ( this format, object arg0, object arg1, object arg2 ) : string

Formats the string with the specified objects for an invariant culture.

GetDigits ( this text ) : string

Get only number characters

IndexOfAll ( this valueCurrent, string value ) : IEnumerable

Gets the indexes of all occurrences of the specified value in the string.

IndexOfCurrent ( this valueCurrent, string value ) : int

Gets the index of the first occurrence of the specified value in the string for the current culture.

IndexOfCurrent ( this valueCurrent, string value, int startIndex ) : int

Gets the index of the first occurrence of the specified value in the string for the current culture.

IndexOfOrdinalIgnoreCase ( this valueCurrent, string value ) : int

Gets the index of the first occurrence of the specified value in the string for ordinal ignoring case.

IndexOfOrdinalIgnoreCase ( this valueCurrent, string value, int startIndex ) : int

Gets the index of the first occurrence of the specified value in the string for ordinal ignoring case.

Join ( this array, string separator ) : string

Joins all elements in the specified array together separated by the specified delimiter.

Join ( this list, string separator ) : string

Joins all elements in the specified list together separated by the specified delimiter.

Left ( this text, int length ) : string

Get first N characters from string

Right ( this text, int length ) : string

Get last N characters from string

StartsWithCurrent ( this valueCurrent, string valueToCompare ) : bool

Gets a value indicating if the string begins with the specified substring for the current culture.

StartsWithOrdinalIgnoreCase ( this valueCurrent, string valueToCompare ) : bool

Gets a value indicating if the string begins with the specified substring for ordinal ignoring case.

ToUnicode ( this text ) : string

Normalize string to unicode

Remove special characters

ToUnicodeWithoutSpace ( this text ) : string

Remove all spaces and normalize string to unicode

Remove special characters

Convert space to underscore

Method Details

CompareNoCase() public static method

Compares two string objects ignoring case.
public static CompareNoCase ( this valueCurrent, string valueToCompare ) : bool
valueCurrent this The current string used to compare against another string.
valueToCompare string The string to compare against the current string.
return bool

ContainedIn() public static method

Determines if the current string is contained in the specified list of objects.
public static ContainedIn ( this valueCurrent, List values ) : bool
valueCurrent this The current string used to compare against the list of objects.
values List The list of objects used compare against the current string.
return bool

ContainedIn() public static method

Determines if the current string is contained in the specified list of strings.
public static ContainedIn ( this valueCurrent, List values ) : bool
valueCurrent this The current string used to compare against the list of strings.
values List The list of strings used compare against the current string.
return bool

ContainedIn() public static method

Determines if the current string is contained in the specified array of objects.
public static ContainedIn ( this valueCurrent, object values ) : bool
valueCurrent this The current string used to compare against the array of objects.
values object The array of objects used compare against the current string.
return bool

EndsWithCurrent() public static method

Gets a value indicating if the string ends with the specified substring for the current culture.
public static EndsWithCurrent ( this valueCurrent, string valueToCompare ) : bool
valueCurrent this The current string to compare against a substring.
valueToCompare string The substring to compare against the current string.
return bool

EndsWithOrdinalIgnoreCase() public static method

Gets a value indicating if the string ends with the specified substring for ordinal ignoring case.
public static EndsWithOrdinalIgnoreCase ( this valueCurrent, string valueToCompare ) : bool
valueCurrent this The current string to compare against a substring.
valueToCompare string The substring to compare against the current string.
return bool

FormatCurrent() public static method

Formats the string with the specified objects for the current culture.
public static FormatCurrent ( this format ) : string
format this The string to format.
return string

FormatCurrent() public static method

Formats the string with the specified object for the current culture.
public static FormatCurrent ( this format, object arg0 ) : string
format this The string to format.
arg0 object The object in which to format in the string.
return string

FormatCurrent() public static method

Formats the string with the specified objects for the current culture.
public static FormatCurrent ( this format, object arg0, object arg1 ) : string
format this The string to format.
arg0 object The first object in which to format in the string.
arg1 object The second object in which to format in the string.
return string

FormatCurrent() public static method

Formats the string with the specified objects for the current culture.
public static FormatCurrent ( this format, object arg0, object arg1, object arg2 ) : string
format this The string to format.
arg0 object The first object in which to format in the string.
arg1 object The second object in which to format in the string.
arg2 object The third object in which to format in the string.
return string

FormatInvariant() public static method

Formats the string with the specified objects for an invariant culture.
public static FormatInvariant ( this format ) : string
format this The string to format.
return string

FormatInvariant() public static method

Formats the string with the specified object for an invariant culture.
public static FormatInvariant ( this format, object arg0 ) : string
format this The string to format.
arg0 object The object in which to format in the string.
return string

FormatInvariant() public static method

Formats the string with the specified objects for an invariant culture.
public static FormatInvariant ( this format, object arg0, object arg1 ) : string
format this The string to format.
arg0 object The first object in which to format in the string.
arg1 object The second object in which to format in the string.
return string

FormatInvariant() public static method

Formats the string with the specified objects for an invariant culture.
public static FormatInvariant ( this format, object arg0, object arg1, object arg2 ) : string
format this The string to format.
arg0 object The first object in which to format in the string.
arg1 object The second object in which to format in the string.
arg2 object The third object in which to format in the string.
return string

GetDigits() public static method

Get only number characters
public static GetDigits ( this text ) : string
text this strign to get numbers
return string

IndexOfAll() public static method

Gets the indexes of all occurrences of the specified value in the string.
public static IndexOfAll ( this valueCurrent, string value ) : IEnumerable
valueCurrent this The current string in which to obtain all indexes of.
value string The value to seek for all occurrences of.
return IEnumerable

IndexOfCurrent() public static method

Gets the index of the first occurrence of the specified value in the string for the current culture.
public static IndexOfCurrent ( this valueCurrent, string value ) : int
valueCurrent this The current string in which to obtain the index of.
value string The value to seek.
return int

IndexOfCurrent() public static method

Gets the index of the first occurrence of the specified value in the string for the current culture.
public static IndexOfCurrent ( this valueCurrent, string value, int startIndex ) : int
valueCurrent this The current string in which to obtain the index of.
value string The value to seek.
startIndex int The search starting position.
return int

IndexOfOrdinalIgnoreCase() public static method

Gets the index of the first occurrence of the specified value in the string for ordinal ignoring case.
public static IndexOfOrdinalIgnoreCase ( this valueCurrent, string value ) : int
valueCurrent this The current string in which to obtain the index of.
value string The value to seek.
return int

IndexOfOrdinalIgnoreCase() public static method

Gets the index of the first occurrence of the specified value in the string for ordinal ignoring case.
public static IndexOfOrdinalIgnoreCase ( this valueCurrent, string value, int startIndex ) : int
valueCurrent this The current string in which to obtain the index of.
value string The value to seek.
startIndex int The search starting position.
return int

Join() public static method

Joins all elements in the specified array together separated by the specified delimiter.
public static Join ( this array, string separator ) : string
array this An array of elements.
separator string The separator for each element.
return string

Join() public static method

Joins all elements in the specified list together separated by the specified delimiter.
public static Join ( this list, string separator ) : string
list this A list of elements.
separator string The separator for each element.
return string

Left() public static method

Get first N characters from string
public static Left ( this text, int length ) : string
text this string text
length int characters length
return string

Right() public static method

Get last N characters from string
public static Right ( this text, int length ) : string
text this string text
length int characters length
return string

StartsWithCurrent() public static method

Gets a value indicating if the string begins with the specified substring for the current culture.
public static StartsWithCurrent ( this valueCurrent, string valueToCompare ) : bool
valueCurrent this The current string to compare against a substring.
valueToCompare string The substring to compare against the current string.
return bool

StartsWithOrdinalIgnoreCase() public static method

Gets a value indicating if the string begins with the specified substring for ordinal ignoring case.
public static StartsWithOrdinalIgnoreCase ( this valueCurrent, string valueToCompare ) : bool
valueCurrent this The current string to compare against a substring.
valueToCompare string The substring to compare against the current string.
return bool

ToUnicode() public static method

Normalize string to unicode

Remove special characters

public static ToUnicode ( this text ) : string
text this string to normalize
return string

ToUnicodeWithoutSpace() public static method

Remove all spaces and normalize string to unicode

Remove special characters

Convert space to underscore

public static ToUnicodeWithoutSpace ( this text ) : string
text this strign to normalize
return string