Answers for "takewhile c# example"

C#
0

takewhile c# example

IList<string> strList = new List<string>() { 
                                            "One", 
                                            "Two", 
                                            "Three", 
                                            "Four", 
                                            "Five", 
                                            "Six"  };

var resultList = strList.TakeWhile((s, i) => s.Length > i);

foreach(string str in resultList)
        Console.WriteLine(str);
Posted by: Guest on November-11-2020
0

takewhile c# example

IList<string> strList = new List<string>() { 
                                            "Three", 
                                            "Four", 
                                            "Five", 
                                            "Hundred"  };

var result = strList.TakeWhile(s => s.Length > 4);

foreach(string str in result)
        Console.WriteLine(str);
Posted by: Guest on November-11-2020

C# Answers by Framework

Browse Popular Code Answers by Language