License:
BSD style: see license.txt
Version:
Initial release: 2005
author:
John Chapman
- class
StringComparer
;
- Compares strings using the specified case and cultural comparision rules.
- this(Culture culture, bool ignoreCase);
- Creates an instance that compares strings using the rules of the specified culture.
Params:
| Culture culture |
A Culture instance whose rules are used to compare strings. |
| bool ignoreCase |
true to perform case-insensitive comparisons; false to perform case-sensitive comparisions. |
- int
compare
(char[] strA, char[] strB);
- Compares two strings and returns the sort order.
Returns:
-1 is strA is less than strB; 0 if strA is equal to strB; 1 if strA is greater than strB.
Params:
| char[] strA |
A string to
compare
to strB. |
| char[] strB |
A string to
compare
to strA. |
- bool
equals
(char[] strA, char[] strB);
- Indicates whether the two strings are equal.
Returns:
true if strA and strB are equal; otherwise, false.
Params:
| char[] strA |
A string to compare to strB. |
| char[] strB |
A string to compare to strA. |
- static StringComparer
currentCulture
();
- Property. Retrieves an instance that performs case-sensitive comparisons using the rules of the current culture.
Returns:
A new StringComparer instance.
- static StringComparer
currentCultureIgnoreCase
();
- Property. Retrieves an instance that performs case-insensitive comparisons using the rules of the current culture.
Returns:
A new StringComparer instance.
- static StringComparer
invariantCulture
();
- Property. Retrieves an instance that performs case-sensitive comparisons using the rules of the invariant culture.
Returns:
A new StringComparer instance.
- static StringComparer
invariantCultureIgnoreCase
();
- Property. Retrieves an instance that performs case-insensitive comparisons using the rules of the invariant culture.
Returns:
A new StringComparer instance.
- alias
StringComparison
;
- Delegate. Represents the method that will handle the string comparison.
Remarks:
The delegate has the signature int delegate(char[], char[]).
- class
StringSorter
;
- Sorts strings according to the rules of the specified culture.
- this(StringComparer comparer = null);
- Creates an instance using the specified StringComparer.
Params:
| StringComparer comparer |
The StringComparer to use when comparing strings. Optional. |
- this(StringComparison comparison);
- Creates an instance using the specified delegate.
Params:
| int delegate(char[], char[]) comparison |
The delegate to use when comparing strings. |
Remarks:
The comparison parameter must have the same signature as StringComparison.
- void
sort
(ref char[][] array);
- Sorts all the elements in an array.
Params:
| char[][] array |
The array of strings to sort. |
- void
sort
(ref char[][] array, int index, int count);
- Sorts a range of the elements in an array.
Params:
| char[][] array |
The array of strings to sort. |
| int index |
The starting index of the range. |
| int count |
The number of elements in the range. |
- static StringSorter
currentCulture
();
- Property. Retrieves an instance that performs a case-sensitive sort using the rules of the current culture.
Returns:
A StringSorter instance.
- static StringSorter
currentCultureIgnoreCase
();
- Property. Retrieves an instance that performs a case-insensitive sort using the rules of the current culture.
Returns:
A StringSorter instance.
- static StringSorter
invariantCulture
();
- Property. Retrieves an instance that performs a case-sensitive sort using the rules of the invariant culture.
Returns:
A StringSorter instance.
- static StringSorter
invariantCultureIgnoreCase
();
- Property. Retrieves an instance that performs a case-insensitive sort using the rules of the invariant culture.
Returns:
A StringSorter instance.
|