read Hexadecimal value from string

Frank Benoit keinfarbton at googlemail.com
Tue Jul 17 13:39:20 PDT 2007


When using Tango, this can be done like this:

import tango.text.convert.Integer;
int  i = toInt( "12AB", 16 );
long l = toLong( "ffffFFFFAAAA", 16 );

see also:
http://www.dsource.org/projects/tango/wiki/ChapterConversions
and the source at
http://www.dsource.org/projects/tango/browser/trunk/tango/text/convert/Integer.d

Frank


More information about the Digitalmars-d-learn mailing list