Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private bool IsColumnInFilter(List<string> filterColumns, string column)
- {
- if (column == null || string.IsNullOrEmpty(column))
- {
- return false;
- }
- foreach (string filterColumn in filterColumns)
- {
- if (column.Contains(filterColumn, StringComparison.OrdinalIgnoreCase))
- {
- Regex regex = new Regex($@"(\A|\W){filterColumn}(\W|\Z)", RegexOptions.IgnoreCase);
- MatchCollection matches = regex.Matches(column);
- if (matches.Count > 0)
- {
- return true;
- }
- }
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement