R
RSH
I have strings that are being converted that need to be eight characters
long. The values are coming in as anywhere between 1 and 8 characters long.
I need to pad the strings with zeros to make all IDs 8 characters long:
Example
Input number Need
1 00000001
121 00000121
10567 00010567
I tried this but it doesn not work, I simply get the same ID back (Example:
2)
sTemp = String.Format("{0:########}", DR["ID"].ToString());
What am I missing?
Thanks,
Ron
long. The values are coming in as anywhere between 1 and 8 characters long.
I need to pad the strings with zeros to make all IDs 8 characters long:
Example
Input number Need
1 00000001
121 00000121
10567 00010567
I tried this but it doesn not work, I simply get the same ID back (Example:
2)
sTemp = String.Format("{0:########}", DR["ID"].ToString());
What am I missing?
Thanks,
Ron