This one is really stupid example, but it really works this way, so why
not...
        Public Shared Function ConvertToHex(text As String) As String
            Dim sb As New StringBuilder()
            For Each b As Byte In text
                sb.Append(b.ToString("x"))
            Next
            Return sb.ToString()
        End Function

2009/11/21 Alan <[email protected]>

> I need to convert an ASCII string to a string of Hex codes
> representing the characters.  Is there a VB.NET function that does
> this, or close to it?
>
> I've searched a lot, but all I find is how to convert ASCII or UTF to
> hex bytes, not a string of Hex characters.
>
> Thanks, Alan
>

Reply via email to