From: Steve Tuckner Date: 2001-08-10T00:01:35+09:00 Subject: [ruby-talk:19435] Simple Question 2 This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_001_01C120E3.0E8903D0 Content-Type: text/plain; charset="iso-8859-1" Is there a built in way to handle conversion of hex values in strings to integers? Examples of possible syntax if it doesn't exist "0xF0".to_i # have it handle leading 0x for hex or 0 for octal or "F0".to_i(16) # pass in the base, assume decimal if no argument. Thanks for the prompt answer to the last one. Steve Tuckner ------_=_NextPart_001_01C120E3.0E8903D0 Content-Type: text/html; charset="iso-8859-1"
Is there a built in way to handle conversion of hex values in strings to integers? Examples of possible syntax if it doesn't exist
 
"0xF0".to_i        # have it handle leading 0x for hex or 0 for octal
 
or
 
"F0".to_i(16)    # pass in the base, assume decimal if no argument.
 
Thanks for the prompt answer to the last one.
 
Steve Tuckner
 
------_=_NextPart_001_01C120E3.0E8903D0--