I'm trying to search my datatable for a possible string pattern. For example I want to search the term "nin" in column A of my datatable, I want it to show all of the rows which has the pattern "nin", even if it is in uppercase or in other format. What I'm currently doing is this:
for(var f = 0; f < dt.Rows.Count; f++)
{
string temp = "nin";
string PositionName = dt.Rows.[f]['ColumnA'].ToString();
int tempColCount = PositionName.Length;
bool searchTerm = PositionName.Substring(0, tempColCount).Contains(temp);
}
But all I'm getting are rows that have the exact pattern as "nin". How do I get the other formats of the same pattern? I'm thinking something like Regex here but I can't understand the tutorials online.