This doesn't work currently: to!int("0xFF"); Python's int() function solves this by taking an optional base argument: http://docs.python.org/library/functions.html#int So it can be called like: clr = int("0000FF", 16) I've seen this used in some functions which convert web colors to an integer. So std.conv could take an optional base argument or maybe try to parse the string and figure out if it's hexadecimal (since this is probably the most commonly used base after base-10).
I should have mentioned in the title that I'm looking for *string* to int conversions.
Looking at the docs, it seems there's parse!int(string, radix) and to!string(int, radix). It's probably worth adding to!int(string, radix) as well (unless it's already there and not showing up in the docs)
*** Issue 6992 has been marked as a duplicate of this issue. ***
https://github.com/D-Programming-Language/phobos/pull/372
Commit pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/42083000a43b569e1d368261678ebd140586ee73 Merge pull request #372 from 9rnsr/fix6255 Issue 6255 - Add support for different base conversions in std.conv
Commit pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/bd9596f9625a6d9a196388b7c18813ccaf3da470 Added Issue# 6255 to the changelog.