HasConsecutiveCharacters Method
Definition
HasConsecutiveCharacters(string, IEnumerable<char>, int)
Determines whether the specified value contains at least one of the succession characters of length.
public static bool HasConsecutiveCharacters(string value, IEnumerable<char> characters, int length = 2)
Parameters
valuestringThe value to test for consecutive characters.
charactersIEnumerable<char>The character to locate with the specified
length.lengthintThe number of characters in succession.
Returns
- bool
trueif the specifiedvaluecontains at least one of the successioncharactersoflength; otherwise,false.
HasConsecutiveCharacters(string, char, int)
Determines whether the specified value contains a succession character of length.
public static bool HasConsecutiveCharacters(string value, char character, int length = 2)
Parameters
valuestringThe value to test for consecutive characters.
charactercharThe characters to locate with the specified
length.lengthintThe number of characters in succession.
Returns
- bool
trueif the specifiedvaluecontains a successioncharacteroflength; otherwise,false.