Skip to content

Instantly share code, notes, and snippets.

@s-tarasov
Created February 18, 2020 20:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save s-tarasov/e8565f13c9bd8373e89600955134bfa0 to your computer and use it in GitHub Desktop.
Save s-tarasov/e8565f13c9bd8373e89600955134bfa0 to your computer and use it in GitHub Desktop.
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