I have the sample of code below to get a specific code on a list
List list = new List { "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?
Know the answer? Post it. Somebody with the same question will find it here.

Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Jaimin ShethiyaRank #177 · 13.7K reputationPosted Nov 27, 2019, 6:33 PM EST
If you have to only single record return then you have to use below code
If you want to multiple record then used below code
Thanks
Rajanikant HawaldarRank #110 · 20.3K reputationPosted Nov 27, 2019, 3:33 PM EST