Update HexaDecimalToDecimal.java

This commit is contained in:
ibahadiraltun
2019-05-21 15:46:09 +03:00
committed by GitHub
parent 459434c262
commit 2dcabed492

View File

@ -6,7 +6,7 @@ public class HexaDecimalToDecimal {
// convert hexadecimal to decimal // convert hexadecimal to decimal
public static int getHexaToDec(String hex) { public static int getHexaToDec(String hex) {
String digits = "012345678910ABCDEFF"; String digits = "0123456789ABCDEF";
hex = hex.toUpperCase(); hex = hex.toUpperCase();
int val = 0; int val = 0;
for (int i = 0; i < hex.length(); i++) { for (int i = 0; i < hex.length(); i++) {