[Solved] C# Split with contains


If you split first, you can use the first column as an Id column and search for exact match:

string line;
using (StreamReader file = new StreamReader(@"db.txt"))
{
    while ((line = file.ReadLine()) != null)
    {
        var values = line.Split(",");
        if (values[0] == "1713")
        {
            label1.Text = values[2];
        }
    }
}

0

solved C# Split with contains