Guest User

Guest User

  • Tech Writer
  • 62
  • 3.5k

Search exact text on list of string

Nov 27 2019 6:39 PM
I have the sample of code below to get a specific code on a list
 
List<string> list = new List<string> { "555", "55", "5", "25" };
var codes = list.Where(x => x.Code.Contains("5"));
 
But it still return the 4 code on the list..
what code should I write? 

Answers (3)