B Benson Feb 8, 2007 #1 Is there any easy way to convert an integer (eg. 1) to a embeded zero string (eg. 00001)? Benson VB2005
Is there any easy way to convert an integer (eg. 1) to a embeded zero string (eg. 00001)? Benson VB2005
S Sergio E. Feb 8, 2007 #2 i think that the following 2 lines must do de trick Dim s As String = String.Empty s.PadLeft(5, "0"c) Best regards, Sergio E.
i think that the following 2 lines must do de trick Dim s As String = String.Empty s.PadLeft(5, "0"c) Best regards, Sergio E.
T Tom Shelton Feb 8, 2007 #3 Is there any easy way to convert an integer (eg. 1) to a embeded zero string (eg. 00001)? Benson VB2005 Click to expand... Console.WriteLine (String.Format ("{0:00000}", 1)) HTH
Is there any easy way to convert an integer (eg. 1) to a embeded zero string (eg. 00001)? Benson VB2005 Click to expand... Console.WriteLine (String.Format ("{0:00000}", 1)) HTH
G Greg Feb 8, 2007 #5 Benson said: Is there any easy way to convert an integer (eg. 1) to a embeded zero string (eg. 00001)? Click to expand... Dim i As Integer = 1 Dim s As String s = i.ToString.PadLeft(5,"0") Cheers.
Benson said: Is there any easy way to convert an integer (eg. 1) to a embeded zero string (eg. 00001)? Click to expand... Dim i As Integer = 1 Dim s As String s = i.ToString.PadLeft(5,"0") Cheers.
G gadgeteer Feb 8, 2007 #6 Was supposed to be 2 lines. Posted before I was finished editing. Dim x As Int32 = 1 Debug.Print(x.To String("DO"))
Was supposed to be 2 lines. Posted before I was finished editing. Dim x As Int32 = 1 Debug.Print(x.To String("DO"))
G gadgeteer Feb 8, 2007 #7 Spellchecker goofed up the code. I think you get the point but here it is again just for grins. Dim x As Int32 = 1 Debug.Print(x.ToString("D5"))
Spellchecker goofed up the code. I think you get the point but here it is again just for grins. Dim x As Int32 = 1 Debug.Print(x.ToString("D5"))
B Benson Feb 8, 2007 #8 Thanks all of you. I try String.Format ("{0:00000}", 1)) with success. Benson.
C ClayB Feb 8, 2007 #9 Might as well make this comment too. This syntax works as well. 1.ToString("000000") ============== Clay Burch Syncfusion, Inc.
Might as well make this comment too. This syntax works as well. 1.ToString("000000") ============== Clay Burch Syncfusion, Inc.