Thanks guys, the following works a treat :) long result; char * endptr; char* cp = new char[ TextString.Length() + 1 ]; strcpy( cp, TextString.c_str() ); result = strtol(cp, &endptr, 16); ResultString = (char) result; Memo2->Lines->Add(ResultString); I have to say Borlands description of StrToInt is very misleading; "StrToInt converts the string S, which represents an integer-type number in either decimal or hexadecimal notation, into a number". Nigel Duckworth ----- Original Message ----- From: "Anthony Toft" To: Sent: Thursday, May 27, 2004 7:59 PM Subject: Re: [OT:] C++ AnsiString conversion? > > > > i.e. "48 65 6C 6C 6F" becomes "Hello" > > > > Borland's StrToInt() doesn't work because you have an HEX number, not > > decimal. There isn't any VCL function to do that, you can: > > > > * Use [standard C] strtol function, passing 16 as the base; > > * Write some simple function to do the conversion. > > > use the strtol to convert the "48" to 0x48, then cast it to a char to turn the > 0x48 to "H" > > -- > http://www.piclist.com hint: The list server can filter out subtopics > (like ads or off topics) for you. See http://www.piclist.com/#topics > -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.