Java tutorial
//package com.java2s; public class Main { private static boolean isAlphaNum(String s) { for (int i = 0; i < s.length(); i++) { char c = s.charAt(i); if (!('0' <= c && c <= '9') && !('A' <= c && c <= 'Z') && " $%*+-./:".indexOf(c) == -1) { return false; } } return true; } }