How can you make a string that is formatted from a value from left to right?
string.Format("{0:00-00-0000}", 123);
The above returns as 00-00-0123
I would like it to be 12-30-0000
Any idea to achieve this?
Try this:
var padded = long.Parse((123).ToString().PadRight(8, '0'));
string.Format("{0:00-00-0000}", padded);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With