str.hex â integer
Instance Public methods
Treats leading characters from str as a string of hexadecimal
digits (with an optional sign and an optional 0x
) and returns
the corresponding number. Zero is returned on error.
1 2 3 4 | "0x0a" .hex #=> 10 "-1234" .hex #=> -4660 "0" .hex #=> 0 "wombat" .hex #=> 0 |
Please login to continue.