I need to parse string hex value to the Integer value. Like this:
String hex = "2A"; //The answer is 42
int intValue = Integer.parseInt(hex, 16);
But when I insert an incorrect hex value (for example "LL") then I get java.lang.NumberFormatException: For input string: "LL" How I can avoid it (for example return 0)?