11 Replies Latest reply: Nov 19, 2009 1:12 PM by 796440 RSS

    Problem with incrementing Hex from string

    807580
      I am having problem incrementing a hex string below then convert it back to string.
      Basically i just want to make ABCDE5AC7E112345 into ABCDE5AC7E112346. I get number format error below and not sure what i am doing wrong. some help appreciated!
      String hex = "ABCDE5AC7E112345";
      int value = Integer.parseInt(hex, 16);
      value++;
      String incHex = Integer.toHexString(value);