static void Main(string[] args) { StudentData sd = new StudentData(); // List<Student> students = sd.GetFilteredStudents(); List <Student> students = sd.GetAllStudents(); List <String> fruits = new List <string> { "appel", "pear", "banana", "strawberry", "lemon" }; foreach (string fruit in fruits) { // Console.WriteLine(fruit.ToUpper()); ConvertString toCaps = x => x.ToUpper(); CountString countString = x => x.Count(); Console.WriteLine(toCaps(fruit) + " telt " + countString(fruit) + " tekens"); // Console.WriteLine(fruit + " telt " + fruit.Count() + " tekens"); } Console.WriteLine(); for (int i = 0; i < fruits.Count() - 1; i++) { CheckString checkString = (x, y) => x.Count() > y.Count(); Console.WriteLine(fruits[i] + " contains more characters then " + fruits[i + 1] + ": " + checkString(fruits[i], fruits[i + 1])); } Console.WriteLine(); foreach (Student student in students) { CheckAge checkAge = (x, y) => x.Age >= y; Console.WriteLine(student.FirstName + " " + student.LastName + " is " + (checkAge(student, 21) ? "" : "not ") + "old enough."); } Console.ReadKey(); }
public bool HasCountNumber() { return(int.TryParse(CountString.Trim(), out int i)); }
public void Merge(CountString Group) { Group.Terminate(); }