Created
May 1, 2018 13:19
-
-
Save Flayed/1a32acc4a928af55b477d562707199b2 to your computer and use it in GitHub Desktop.
String Interpolation with Composite Formatting
This file contains hidden or 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
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