Answers for "c# align text string"

C#
4

c# center text

// Console app: center text
Console.WriteLine(String.Format("{0," + Console.WindowWidth / 2 + "}", "TEXT"));
Posted by: Guest on October-30-2020
1

c# center text

string s = "Hello|World";
Console.SetCursorPosition((Console.WindowWidth - s.Length) / 2, Console.CursorTop);
Console.WriteLine(s);
Posted by: Guest on March-12-2022

C# Answers by Framework

Browse Popular Code Answers by Language