Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Console.Write("Input a String : ");
- string variable = Console.ReadLine();
- char[] ch = variable.ToCharArray();
- if (!(ch[0] < 47 || ch[0] > 58))
- {
- Console.Write("Kindly Check because first character won't accept Space \n nor Digit or Special Character. \n THANK YOU");
- }
- else
- {
- foreach (char cha in variable)
- {
- Convert.ToInt32(cha);
- if ((!(cha < 64 || cha > 90) || !(cha < 97 || cha > 122) || !(cha < 48 || cha > 57) || (cha == 95)))
- {
- }
- else
- {
- Console.WriteLine(cha + " is an invalid character\n Whole string will be Invalid");
- Console.ReadLine();
- return;
- }
- }
- Console.WriteLine("Variable string is VALID");
- }
- Console.ReadLine();
- }
- //coded by : ACT
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement