Advertisement
okanfeim

EGN

Apr 27th, 2017
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.74 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace EgnValidatingg
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             Console.WriteLine("Please enter EGN !");
  14.             CheckEGN();
  15.         }
  16.         static void CheckEGN()
  17.         {
  18.             string EGN = Console.ReadLine();
  19.             if (EGN.Any(Char.IsSymbol) || EGN.Length != 10 || EGN.Any(Char.IsLetter))
  20.             {
  21.                 Console.WriteLine("Invalid format.EGN must contain only digits ! ");
  22.             }
  23.             else
  24.             {
  25.                  Console.WriteLine("Valid EGN format");
  26.             }
  27.              
  28.             }
  29.         }
  30.  }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement