Java tutorial
//package com.java2s; //License from project: Open Source License public class Main { public static String checkAndChangeDataHexa(String sInput) { String CheckedAndChangedValue = ""; 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') { CheckedAndChangedValue += cInput[i]; } } return CheckedAndChangedValue; } }