Guest User

Untitled

a guest
Feb 20th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.47 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Misc {
  4.     class Program {
  5.         static void Main (string[] args) {
  6.             string str = Console.ReadLine();
  7.             string newStr = null;
  8.             foreach (char ch in str) {
  9.                 bool isUpCaseLetter  = ch >= 'A' && ch <= 'E';
  10.                 bool isLowCaseLetter = ch >= 'a' && ch <= 'e';
  11.                 bool isDigit         = char.IsDigit (ch);
  12.                 if (isUpCaseLetter || isLowCaseLetter || isDigit)
  13.                     newStr += ch;
  14.             }
  15.             Console.WriteLine (newStr);
  16.             Console.ReadLine ();
  17.         }
  18.     }
  19. }
Add Comment
Please, Sign In to add comment