title: Java: converting each letter into the number for example a = 1, b = 2, c = 3
body: <pre><code>char[] alphabet = {'a','b','c','d','e','f','g','h','i','j','k','l'...};
  
  int number = 0;
  
  char input = console.nextLine().charAt(0);
  
  for (int i = 0; i &lt;= 24; i++) {
     if(Character.isLetter(alphabet[i])) {
        number = i;
     }
  }
  System.out.println(number);
  </code></pre>
  
  <p>I want each letter to be converted into a number for example </p>
  
  <blockquote>
    <p>a = 1;  b = 2;  c = 3...  and so on.</p>
  </blockquote>
  
  <p>but it keeps turning 'number' into 10 for some reason
  help pls
  my code is a complete mess</p>