Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

c# center text

// Console app: center text
Console.WriteLine(String.Format("{0," + Console.WindowWidth / 2 + "}", "TEXT"));
Comment

c# center text


string s = "Hello|World";
Console.SetCursorPosition((Console.WindowWidth - s.Length) / 2, Console.CursorTop);
Console.WriteLine(s);

Comment

PREVIOUS NEXT
Code Example
Csharp :: unity how to set an objects postion x,y,z 
Csharp :: movement script c# 
Csharp :: kotlin random number 
Csharp :: how to clear console in c# 
Csharp :: restclient basic auth c# 
Csharp :: unity 2d jump 
Csharp :: c# unix timestamp 
Csharp :: asp.net data annotations Datetime 
Csharp :: play a sound c# 
Csharp :: enum loop 
Csharp :: c# initialize dictionary 
Csharp :: writeline c# 
Csharp :: unity why is there no transform.left 
Csharp :: c# output double with precision 
Csharp :: Csharp cast string to double 
Csharp :: easily start admin process from service c# 
Csharp :: c# reverse list 
Csharp :: unity spawn object at position 
Csharp :: c# how to add newline on text box 
Csharp :: unity string array 
Csharp :: unity movetowards 2d 
Csharp :: how to draw text in monogame 
Csharp :: c# round to 2 decimal places 
Csharp :: unity move character 
Csharp :: sum of two numbers in c# 
Csharp :: mymove() method c# 
Csharp :: restart wpf application 
Csharp :: unity check if audio playing 
Csharp :: remove focus from button unity 
Csharp :: c# add guid to array 
ADD CONTENT
Topic
Content
Source link
Name
8+3 =