Skip to content

Instantly share code, notes, and snippets.

@jasmin-mistry
Created September 22, 2022 22:01
Show Gist options
  • Save jasmin-mistry/81699650d585decee306bbbedd3ffa38 to your computer and use it in GitHub Desktop.
Save jasmin-mistry/81699650d585decee306bbbedd3ffa38 to your computer and use it in GitHub Desktop.
String Width & Alignment
var number = 1;
new List<string>
{
$"|{number}|", // |1|
$"|{number, -10}|", // |1 |
$"|{number, 10}|" // | 1|
}.ForEach(Console.WriteLine);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment