I am currently working on a project where I need to format a string to be only 10 characters long. But has to start in a certain way and finish with an incrementing counter.
E.G the number will be in the format of:
0100000001
0100000002
0100000003
...
0100000010
0100000011
I.e. the first two numbers will stay the same only the last digits will keep incrementing but the string has to remain 10 characters long.
How could I do this I have tried using String.Format but doesn’t appear to work.
UPDATE
I’ve tried using the following
destination = String.Format("07000000{0}", messageCount);
This kind of works but once the messageCount gets above 10 the length becomes 11 and it needs to stay no longer than 10
try