Is there anything equavilant to this in c#.net??

this is a vb.net code help me to convert string to hex...

Microsoft.VisualBasic.Right("00" & Hex(b(i)), 2)

is there any method or class or anything give me the same result of this in c#.net ...

help me please..

thanks in advance



Answer this question

Is there anything equavilant to this in c#.net??

  • dragoncells

    b(i).ToString("X2")

    if you do this in a loop I recommend using the StringBuilder class instead.



  • Ofir Epstein

    ublic string ArabicHex(byte[] b)

    {

    string temp,s="",h;

    int i;

    for (i=b.GetUpperBound(0);i > -1;i--)

    {

    temp= bIdea.ToString("x2");

    h = temp.Substring(temp.Length-2).ToUpper();

    s=s+h;

    }

    return s;

    }

    somethig like this right

    but this always returns the string in reverse order

    in two ways ... the first by reversing the words ...

    and the second by reversing the characters in each word ..

    the first when I do s=s+h

    and the second when I make s=h+s

    what is the solution then...


  • Is there anything equavilant to this in c#.net??