Skip to content

Instantly share code, notes, and snippets.

@Flayed
Created May 1, 2018 13:25
Show Gist options
  • Save Flayed/20c0721a3324bdad499158420f2c0691 to your computer and use it in GitHub Desktop.
Save Flayed/20c0721a3324bdad499158420f2c0691 to your computer and use it in GitHub Desktop.
Number padding
int myNumber = 42;
// Adjust the first parameter to PadLeft to adjust the number of zeroes
string serialNumber = $"AXT{myNumber.ToString().PadLeft(5, '0')}";
// serialNumber = AXT00042
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment