in vb6 i could do this....
'Add leading zeros
nGroup = String(6 - Len(nGroup), "0") & nGroup
whats the equivalent in vb.net?
Cheers,
Craig
Printable View
in vb6 i could do this....
'Add leading zeros
nGroup = String(6 - Len(nGroup), "0") & nGroup
whats the equivalent in vb.net?
Cheers,
Craig
The PadLeft function.
VB.Net Code:
nGroup = nGroup.PadLeft(6,"0"c)
EDIT: sorry, small mistake in the code. The first argument should be a value determining the length of the resulting string, so it should be 6.
nice one, cheers!! :thumb: