skip to Main Content

C# LINQ to select element from string array – Asp.net

I have a string: private const string Codes = "2,10"; public void method() { var displayCodes = Codes.Split(','); DemoResponse response = webService.GetResponse(); //getting response from API if(response.Errors.Any(x => displayCodes.Contains(x.StackTrace)) { int myCode = int.Parse(response.Errors.Select(x => x.StackTrace).FirstOrDefault()); } } This is…

VIEW QUESTION
Back To Top
Search