3
Answers

Search exact text on list of string

Guest User

Guest User

5y
406
1
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)