Advertisement
Spocoman

05. Digits, Letters and Other

Apr 12th, 2023 (edited)
691
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.49 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3. using System.Collections.Generic;
  4.  
  5. namespace DigitsLettersAndOther
  6. {
  7.  
  8.     class Program
  9.     {
  10.         static void Main()
  11.         {
  12.             string text = Console.ReadLine();
  13.  
  14.             Console.WriteLine(string.Join("", text.Where(x => char.IsDigit(x))));
  15.             Console.WriteLine(string.Join("", text.Where(x => char.IsLetter(x))));
  16.             Console.WriteLine(string.Join("", text.Where(x => !char.IsLetterOrDigit(x))));
  17.         }
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement