Created
January 13, 2017 21:30
-
-
Save sachintha81/09a7a2dae461aee1cc5282b26627fc7a to your computer and use it in GitHub Desktop.
Indenting C# String Data with Tabs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Concurrent; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace StringIndent | |
{ | |
public class StringIndent | |
{ | |
public static void main() | |
{ | |
// Left Align | |
Console.WriteLine(""{0,-10}\t{1,-5}\t{2,-5}\t{3,-10}"", var1, var2, var3, var4); | |
// Right Align | |
Console.WriteLine(""{0,10}\t{1,5}\t{2,5}\t{3,10}"", var1, var2, var3, var4); | |
// Amount of padding must be set to the longest possible value of var1, var2 etc... | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment