Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Text.RegularExpressions;
- namespace ConsoleTests
- {
- class ConsoleTests
- {
- static void Main()
- {
- string input;
- bool isValid;
- do
- {
- Console.Write("Enter string (20 characters max): ");
- input = Console.ReadLine();
- isValid = input.Length > 0 && input.Length <= 20;
- if (isValid == false)
- {
- Console.WriteLine("Invalid string");
- }
- } while (isValid == false);
- Console.WriteLine("Result: {0}",input.PadRight(20,'*'));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment