Java tutorial
//package com.java2s; //License from project: Open Source License public class Main { public static boolean checkDataHexa(String sInput) { boolean checkedValue = true; sInput = sInput.toUpperCase(); char[] cInput = sInput.toCharArray(); for (int i = 0; i < sInput.length(); i++) { if (cInput[i] != '0' && cInput[i] != '1' && cInput[i] != '2' && cInput[i] != '3' && cInput[i] != '4' && cInput[i] != '5' && cInput[i] != '6' && cInput[i] != '7' && cInput[i] != '8' && cInput[i] != '9' && cInput[i] != 'A' && cInput[i] != 'B' && cInput[i] != 'C' && cInput[i] != 'D' && cInput[i] != 'E' && cInput[i] != 'F') { checkedValue = false; } } return checkedValue; } }