Advertisement
Guest User

Untitled

a guest
Jan 28th, 2013
209
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.     class StringFilled
  4.     {
  5.         static void Main()
  6.         {
  7.             Console.WriteLine("Enter a string smaller than 20 characters");
  8.             string text = Console.ReadLine();
  9.             if (text.Length<20)
  10.             {
  11.                 int length = 20-text.Length;
  12.                 string add = new string('*', length);
  13.                 text=text+add;
  14.             }
  15.             Console.WriteLine("The new one: {0}", text);
  16.  
  17.         }
  18.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement