Meraj99 Meraj99 - 5 months ago 48 Question

How to center text in (Console)

I want to print text "TEST" (Console.WriteLine) in the center of my console application. How would I go about doing so?

Looking for 'beginner-friendly' answers.


You'll need to get the console with, get the length of the string you're about to display and, subtract the second from the first, divide this in half and pad the string with this number of spaces.