Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

How to center text in console application

    //copy this into your IDE
    //write your own text instead of "Custom Text" and run
    string textToEnter = "Custom Text";
    Console.WriteLine(String.Format("{0," + ((Console.WindowWidth / 2) + (textToEnter.Length / 2)) + "}", textToEnter));
    Console.Read();
Comment

PREVIOUS NEXT
Code Example
Csharp :: c# fizzbuzz 
Csharp :: get enum int by name 
Csharp :: pass datatable to stored procedure c# dapper 
Csharp :: save file dialog filter c# 
Csharp :: wpf yes no message box exit 
Csharp :: get desktop path c# 
Csharp :: how to set a objects position to the mouse unity 
Csharp :: random unity 
Csharp :: newtonsoft json conditionally ignore property 
Csharp :: c# + longest streak in strings 
Csharp :: c# split string for all blank character 
Csharp :: c sharp if string equals 
Csharp :: c sharp split string 
Csharp :: stack to string c# 
Csharp :: querymultiple dapper c# 
Csharp :: get length of a string c# 
Csharp :: remove first character in a string c# 
Csharp :: bootrap modal 
Csharp :: c# OnMouseUp unity 
Csharp :: c# how to terminate console application 
Csharp :: discord bot status code c# 
Csharp :: how to get key value from json object in c# 
Csharp :: how to add item to listbox in c# 
Csharp :: tostring tmpro unity 
Csharp :: int to ascii c# 
Csharp :: how to make an object appear and disappear in unity 
Csharp :: C# array index tostring 
Csharp :: key value pair in c# 
Csharp :: c# get pressed key 
Csharp :: c# if statement one line 
ADD CONTENT
Topic
Content
Source link
Name
7+6 =