Advertisement
desislava_topuzakova

07. Predicate For Names

Jun 3rd, 2022
1,095
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.41 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3.  
  4. namespace PredicateForNames
  5. {
  6.     class PredicateForNames
  7.     {
  8.         static void Main(string[] args)
  9.         {
  10.             int n = int.Parse(Console.ReadLine());
  11.             Predicate<string> cond = str => str.Length <= n;
  12.             Console.ReadLine().Split(" ", StringSplitOptions.RemoveEmptyEntries).ToList().FindAll(cond).ForEach(Console.WriteLine);
  13.         }
  14.     }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement