Advertisement
XfreeBG

Untitled

Nov 12th, 2022
24
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.73 KB | None | 0 0
  1. string input = Console.ReadLine();
  2.             int adekvatno = 0;
  3.             string chars = "~`!@#$%^&*()_-+={[}]|:;'<,>.?/";
  4.             char[] symbols = { '~', '`', '!', '@', '#', '$', '%', '^', '&', '*', '(', ')', '_', '-', '+', '=', '{', '[', '}', ']', '|', ':', ';', '<', ',', '>', '.', '?', '/' };
  5.             for (int a = 0; a < symbols.Length; a++)
  6.             {
  7.                 if (input.Contains(symbols[a]))
  8.                 {
  9.                     Console.WriteLine("Has symbols");
  10.                     adekvatno++;
  11.                     break;
  12.                 }
  13.             }
  14.             if(adekvatno == 0)
  15.             {
  16.                 Console.WriteLine("The password must contains at least 1 special character");
  17.             }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement