@Test public void testCleanHexPrefix() { String[][] exampleData = new String[][]{ new String[]{ "0x1020AF", "1020AF" }, new String[]{ "1020AF", "1020AF" }, new String[]{ "", "" } }; for (String[] test : exampleData) { assertEquals(test[1], NumericUtil.cleanHexPrefix(test[0])); } }
public static String cleanHexPrefix(String input) { if (hasHexPrefix(input)) { return input.substring(2); } else { return input; } }
NumericUtil { public static String cleanHexPrefix(String input) { if (hasHexPrefix(input)) { return input.substring(2); } else { return input; } } }
NumericUtil { public static String cleanHexPrefix(String input) { if (hasHexPrefix(input)) { return input.substring(2); } else { return input; } }  }
NumericUtil { public static String cleanHexPrefix(String input) { if (hasHexPrefix(input)) { return input.substring(2); } else { return input; } }  static byte[] generateRandomBytes(int size); static boolean isValidHex(String value); static String cleanHexPrefix(String input); static String prependHexPrefix(String input); static BigInteger bytesToBigInteger(byte[] value, int offset, int length); static BigInteger bytesToBigInteger(byte[] value); static BigInteger hexToBigInteger(String hexValue); static String bigIntegerToHex(BigInteger value); static String bigIntegerToHexWithZeroPadded(BigInteger value, int size); static byte[] bigIntegerToBytesWithZeroPadded(BigInteger value, int length); static byte[] hexToBytes(String input); static byte[] hexToBytesLittleEndian(String input); static byte[] reverseBytes(byte[] bytes); static String bytesToHex(byte[] input); static String beBigEndianHex(String hex); static String beLittleEndianHex(String hex); static int bytesToInt(byte[] bytes); static byte[] intToBytes(int intValue); }
NumericUtil { public static String cleanHexPrefix(String input) { if (hasHexPrefix(input)) { return input.substring(2); } else { return input; } }  static byte[] generateRandomBytes(int size); static boolean isValidHex(String value); static String cleanHexPrefix(String input); static String prependHexPrefix(String input); static BigInteger bytesToBigInteger(byte[] value, int offset, int length); static BigInteger bytesToBigInteger(byte[] value); static BigInteger hexToBigInteger(String hexValue); static String bigIntegerToHex(BigInteger value); static String bigIntegerToHexWithZeroPadded(BigInteger value, int size); static byte[] bigIntegerToBytesWithZeroPadded(BigInteger value, int length); static byte[] hexToBytes(String input); static byte[] hexToBytesLittleEndian(String input); static byte[] reverseBytes(byte[] bytes); static String bytesToHex(byte[] input); static String beBigEndianHex(String hex); static String beLittleEndianHex(String hex); static int bytesToInt(byte[] bytes); static byte[] intToBytes(int intValue);  }