Provides static methods working with character arrays.
Public Static Fields | |
static readonly char[] | DefaultWhitespaces = {' ','\r','\n','\t' } |
static readonly String | NewLineChars =Environment.NewLine |
static readonly char[] | NullBuffer = new char[0] |
Public Static Methods | |
static bool | AdjustRegion (int referenceLength, ref int regionStart, ref int regionLength) |
static int | CompareTo (char[] needle, int needleStart, int needleLength, char[] haystack, int haystackStart, int haystackLength, Case sensitivity) |
static int | CompareTo (String needle, int needleStart, int needleLength, char[] haystack, int haystackStart, int haystackLength, Case sensitivity) |
static bool | ContainsAt (char[] needle, int needleStart, int needleLength, char[] haystack, int haystackPos, int haystackLimit, Case sensitivity=Case.Sensitive) |
static bool | ContainsAt (String needle, char[] haystack, int haystackPos, int haystackLimit, Case sensitivity=Case.Sensitive) |
static int | IndexOf (char[] haystack, char needle, int regionStart=0, int regionLength=int.MaxValue) |
static int | IndexOfAnyInRegion (char[] haystack, int regionStart, int regionLength, char[] needles, Inclusion inclusion) |
static int | IndexOfFirstDifference (char[] haystack, int haystackStart, int haystackLength, String needle, Case sensitivity) |
static int | IndexOfString (char[] needle, int needleStart, int needleLength, char[] haystack, int haystackStart, int haystackLength, Case sensitivity) |
static int | IndexOfString (String needle, char[] haystack, int haystackStart, int haystackLength, Case sensitivity) |
static int | LastIndexOfAny (char[] haystack, int regionStart, int regionLength, char[] needles, Inclusion inclusion) |
|
inlinestatic |
Static method that adjusts a given region to fit into the range [0 .. referenceLength].
referenceLength | Length of the string that the given region will be adjusted to. | |
[in,out] | regionStart | The start of the region to be adjusted. |
[in,out] | regionLength | The length of the region to be adjusted. |
|
inlinestatic |
Compares two regions of two char[].
No parameter checks are performed. Null and empty checks and proper region bounds have to be provided (this is a helper method for other compareTo methods).
needle | A char[] that is compared to this. |
needleStart | The start of the substring within needle. |
needleLength | The length of the substring within needle. |
haystack | The char[] that is to compared. |
haystackStart | The start of the substring within haystack. |
haystackLength | The length of the substring within haystack. |
sensitivity | Case sensitivity of the operation. |
|
inlinestatic |
Compares a region of a String with another region in a char[].
No parameter checks are performed. Null and empty checks and proper region bounds have to be provided (this is a helper method for other compareTo methods).
needle | A String that is compared to this. |
needleStart | The start of the substring within needle. |
needleLength | The length of the substring within needle. |
haystack | The character buffer that is to compared. |
haystackStart | The start of the substring within haystack. |
haystackLength | The length of the substring within haystack. |
sensitivity | Case sensitivity of the operation. |
|
inlinestatic |
Checks if a region of a char[] is located at the given position of another char[].
needle | The character array containing the needle. |
needleStart | The index of the start of the needle within the character array. |
needleLength | The length of the needle within the character array. |
haystack | The character array to look in for the needle. |
haystackPos | The position to look at in haystack. |
haystackLimit | The length of the haystack (may be equal or less than haystack.Length). |
sensitivity | Case sensitivity of the comparison. Optional and defaults to Case.Sensitive. |
true
if the needle is found at the given position. false
otherwise.
|
inlinestatic |
Checks if the given String is located at the given position in a char[].
needle | The character array containing the needle. |
haystack | The character array to look in for the needle. |
haystackPos | The position to look at in haystack. |
haystackLimit | The length of the haystack (may be equal or less than haystack.Length. |
sensitivity | Case sensitivity of the comparison. Optional and defaults to Case.Sensitive. |
true
if the needle is found at the given position. false
otherwise.
|
inlinestatic |
Static method that searches a character in a region of a character array.
haystack | Character array that is searched in. |
needle | The character to be searched for. |
regionStart | The start of the region within haystack. Defaults to 0. |
regionLength | The length of the region within haystack. Defaults to int.MaxValue. |
|
inlinestatic |
Static method that returns the index of the first character which is included (alternatively not included) in a given set of characters.
This method searches from left to right. For backward search, see LastIndexOfAny
haystack | Character array that is searched in. |
regionStart | The start of the region within haystack. |
regionLength | The length of the region within haystack. |
needles | Character array that holds the characters to be searched for. |
inclusion | Denotes whether the search returns the first index that holds a value that is included or that is not excluded in the set of needle characters. |
|
inlinestatic |
Static method that returns the index of the first character which not equal within two strings. If haystack starts with needle, then the length of needle is returned.
haystack | Character array that is searched in. |
haystackStart | The start of the region within haystack. |
haystackLength | The length of the region within haystack. |
needle | The string to be searched for. |
sensitivity | The sensitivity to the case of characters of the operation. |
|
inlinestatic |
Search the given AString in a region of a character array.
needle | The string to be searched for. |
needleStart | The start of the region within haystack. |
needleLength | The length of the region within haystack. |
haystack | Character array that is searched in. |
haystackStart | The start of the region within haystack. |
haystackLength | The length of the region within haystack. |
sensitivity | The sensitivity to the case of characters of the operation. |
|
inlinestatic |
Search the given String in a region of a character array.
needle | The string to be searched for. |
haystack | Character array that is searched in. |
haystackStart | The start of the region within haystack. |
haystackLength | The length of the region within haystack. |
sensitivity | The sensitivity to the case of characters of the operation. |
|
inlinestatic |
Static method that returns the index of the first character which is included (alternatively not included) in a given set of characters. The search starts at the end of the region and continues towards its start.
haystack | Characer array to search in. |
regionStart | The start of the region within haystack. |
regionLength | The length of the region within haystack. |
needles | Characer array that holds the characters to be searched for. |
inclusion | Denotes whether the search returns the first index that holds a value that is included or that is not excluded in the set of needle characters. |
|
static |
Contains all characters that by default get trimmed by trim methods defined in this class.
|
static |
The system depended new line character codes retrieved statically (once) using "Environment.NewLine;"
|
static |
A singleton that references a zero-length character array. May be used to avoid object allocation.