Skip to content

Instantly share code, notes, and snippets.

@sachintha81
Created January 13, 2017 21:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sachintha81/09a7a2dae461aee1cc5282b26627fc7a to your computer and use it in GitHub Desktop.
Save sachintha81/09a7a2dae461aee1cc5282b26627fc7a to your computer and use it in GitHub Desktop.
Indenting C# String Data with Tabs
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