What OP wants to do, apparently, is convert a String that contains "0x11" to 17 (0x11). The toInt() method won't do that, because it, rightly, expects the string to be a base 10 representation of the value.
OP: Stop using Strings. You can pass a string (which is NOT the same as a String) to strtoul(), which can interpret numbers in any base, to get an unsigned long.