Hi,

i have a card number and i convert it into hexadecimal. After that i wan to set the format to 6 digit if the hexa card number has a length =5. so how i'm going to set the format?

Dim value As Long
value = Convert.ToInt64(CardNo)
dim CNo as string = value.ToString("X")
 If CNo.Length <> 6 Then
    CNo = String.Format("{0:000000}")
 End If

if card number in hexa = E0378, the answer should be 0E0378.

You forgot to define a value in the String format:

Dim intValue As Integer = 12345
Dim strValue As String = [String].Format("{0:000000}", intValue)
'output is : 012345

Hi,

You can try something like this:

Dim value As Long
        value = Convert.ToInt64(CardNo)
        Dim CNo As String = value.ToString("X")
        CNo.padleft(6, "0")

I didn't tested it.