This is one is short, but I can't find the answer anywhere.
Is there a jdk routine that can parse a string to an int, and autodetect and convert C-style programming conventions:
I can't remember such function in standard JDK.
If you want to auto detect style, you cat write helper function with
First, check if number string starts with
0x, if no - check if it starts with
0 at all. But this won't work if you will have binary number. But there are no such in your question ^_^.
See Integer.parse(String s, radix) method.