Hi, i have this code
How can i make this code to look for EXACT MATCH?
For example, with the current code if i have in the table a keyword like
Test Keyword 2 test
And the next variable is like "Test Keyword 2"
it will tell me that this keyword already exist in the table.
How can i fix this?
Код:
// take text for search from a variable
var textContains = project.Variables["tableSearchTextContains"].Value;
// get table for search
var sourceTable = project.Tables["SourceTable"];
// search in each row
lock(SyncObjects.TableSyncer)
{
for(int i=0; i < sourceTable.RowCount; i++)
{
// read a row (array of cells)
var cells = sourceTable.GetRow(i).ToArray();
// loop through all cells
for (int j=0; j < cells.Length; j++)
{
// check if cell contains specified text, if there are matches return "yes"
if (cells[j].Contains(textContains))
return "yes";
}
}
}
// if nothing found return "no"
return "no";
For example, with the current code if i have in the table a keyword like
Test Keyword 2 test
And the next variable is like "Test Keyword 2"
it will tell me that this keyword already exist in the table.
How can i fix this?