Advertisement
2629881

Untitled

Jul 25th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.62 KB | None | 0 0
  1. static void Main(string[] args)
  2.         {
  3.             Console.Write("Hello");
  4.             //Console.Write(new string('\n', 10));
  5.             //Console.Write("ten lines later :-)");
  6.             WriteTextInPosition("Not yet a moving line", 10);
  7.             Console.ReadKey();
  8.          
  9.            
  10.         }
  11.         public static void WriteTextInPosition(string text, int top)
  12.         {
  13.             for (int i = 0; i < top; i++)
  14.             {
  15.                 Console.WriteLine();
  16.             }
  17.             Console.WriteLine(String.Format("{0," + ((Console.WindowWidth / 2) + (text.Length / 2)) + "}", text));
  18.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement