formatting - C# convert int to string with padding zeros? -
in c# have integer value need convereted string needs add zeros before:
for example:
int = 1;
when convert string needs become 0001
i need know syntax in c#.
i.tostring().padleft(4, '0')
- okay, doesn't cover cases
i.tostring("0000");
- explicit form
i.tostring("d4");
- short form format specifier
Comments
Post a Comment