Skip to content

Instantly share code, notes, and snippets.

@Flayed
Created May 1, 2018 13:19
Show Gist options
  • Save Flayed/1a32acc4a928af55b477d562707199b2 to your computer and use it in GitHub Desktop.
Save Flayed/1a32acc4a928af55b477d562707199b2 to your computer and use it in GitHub Desktop.
String Interpolation with Composite Formatting
int myNumber = 42;
// Adjust the number after D to adjust the number of leading zeroes
string serial = $"AXT{myNumber:D5}";
// serial = AXT00042
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment