checking a String for anything other than an integar or character a - z
<p>This is dealing with java to start.
My goal is to take in a Vin number and store it into a string.  Make sure it has no more than 9 characters.  Also the Vin Number is only suppost to contain numbers and letters a-z or A-Z. If the user inputs an invalid Vin number it should loop back around and prompt for a new Vin Number. My problem is telling whether the string contains anything other than integars or letters.  I've seen the Utility.IsAlphaNumeric method but i cant figure out how to impliment it or whether it's even a java method. NetBeans gives me errors when ever i try to use it. </p>

<pre><code>private static String checkVin() {
    Scanner input = new Scanner(System.in);
    String vinNumber = "";
    do {
        System.out.println("Please enter the vin number of the car");
        vinNumber = input.next();
        if (vinNumber.length() &gt; 9) {
            System.out.println("invalid input for Vin number");
        }
        for (int i = 0; i &lt; vinNumber.length(); i++) {
            char currentCharacter = vinNumber.charAt(i);

            if ((currentCharacter &lt; '0' || currentCharacter &gt; '9')
                    || !( currentCharacter &lt; 'a' || currentCharacter &gt; 'z')
                    || !(currentCharacter &gt; 'A' || currentCharacter &gt; 'Z'));
            System.out.println("invalid input for Vin Number");
            break;
        }
        return vinNumber;

    } while (true);
}
</code></pre>
