From Borland non-tech forum, ozbear wrote: Q: How do I get the hexadecimal string representation of an integer? A1: s = String.Format('{0:X8}',yourint); // upper case hex A2: s = String.Format('{0:x8}',yourint); // lower case hex Q: How do I get the hexadecimal string representation of an character? A1: s = String.Format('{0:X4}',(int)yourchar); // upper case hex A2: s = String.Format('{0:x4}',(int)yourchar); // lower case hex
In the integer example, yourInt.ToString('X8') is another option. |