Created
February 18, 2020 20:47
-
-
Save s-tarasov/e8565f13c9bd8373e89600955134bfa0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static bool SplitContains(string values, string value) | |
{ | |
int position = 0; | |
foreach (var c in values) | |
{ | |
if (c == ',') | |
{ | |
if (position == value.Length) | |
return true; | |
else | |
position = 0; | |
} | |
else if (position != -1) | |
{ | |
if (value[position] == c) | |
position++; | |
else | |
position = -1; | |
} | |
} | |
return position == value.Length; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment