title: Check if characters in a firstname String contain at least 1 digit
body: <p>I try to check if characters in a firstname String contain at least 1 digit, if yes ask to the user to input it again and then going back to the loop and check again but with a GoTo break it only works the first time and won't loop it again. Oh and I do this from a method with a String array of more than only a first name in it. Isn't the break GoTo supposed to bring me back to my label and then do the loop over again looking for a digit?</p>
  <pre><code>public static void main(String[] args) {
      infoInputGathering();
  }
  public static String[] infoInputGathering(){
      String[] infos = new String[3]; // Declaration of the infos String array
      boolean isStringOnly;
      char[] characterChecker;
  
      Scanner input = new Scanner(System.in); // Creation of the Scanner object input
      // Asking the user to input their first name and stores it in a String Array info[0]
      System.out.print(&quot;Enter your first name: &quot;);
      infos[0] = input.next();
      characterChecker = infos[0].toCharArray();
      
      firstname:
      for (int c = 0 ; c&lt;=characterChecker.length ; ++c ) {
          if (Character.isDigit(characterChecker[c])) {
              System.out.println(&quot;A first name should not contain any number...&quot;);
              System.out.print(&quot;Enter your first name without a number: &quot;);
              infos[0] = input.next();
              characterChecker = infos[0].toCharArray();
              Break firstname;
          }
      }
  </code></pre>
  <p>Final Full Code I came up with with Ali's help on this part</p>
  <pre><code>import java.util.Scanner;
  import java.util.ArrayList;
  
  public class InfiniteInfoGatheringUntilStop {
  
  public static void main(String[] args) {
      int iterationsCounter = 0; // Declares/Initiate a counter for the loops
      Scanner input = new Scanner(System.in); // Creation of the Scanner object input
  
      ArrayList&lt;String&gt; names = new ArrayList&lt;String&gt;(); // Creates an ArrayList for the names inputs
      ArrayList&lt;String&gt; birth = new ArrayList&lt;String&gt;(); // Creates an ArrayList for the date of birth inputs
      ArrayList&lt;String&gt; gpa = new ArrayList&lt;String&gt;(); // Creates an ArrayList for the GPA inputs
  
      while(true){ // Always true loop unless break out on if conditions
  
          System.out.print(&quot;Enter your name: &quot;);
          names.add(input.next());
          //Code to check if there are numerical character in the String of the listArray inputted
          char[] characterChecker = names.get(iterationsCounter).toCharArray(); //Declare and initiates an array of character from the ArrayList names(iterationsCounter)
          int c = 0;
          while(true){ // Loop to check every character and asks for a retype if detects one character as numerical
              if(Character.isDigit(characterChecker[c])){
                  System.out.println(&quot;A first name should not contain any number...&quot;);
                  System.out.print(&quot;Enter your first name without a number: &quot;);
                  names.set(iterationsCounter,input.next());
                  characterChecker = names.get(iterationsCounter).toCharArray();
                  c = 0;
              }
              else {
                  c++;
              }
              if(c == characterChecker.length){
                  break;
              }
          }
          if(names.get(iterationsCounter).equalsIgnoreCase(&quot;stop&quot;)){ //Checks if stop has been typed, breaks in that case but erases previous ArrayLists of this cycle
              names.remove(iterationsCounter);
              break;
          }
          System.out.print(&quot;Enter your date of birth in this format AAAAmmdd: &quot;);
          birth.add(input.next());
          characterChecker = birth.get(iterationsCounter).toCharArray(); //Declare and initiates an array of character from the ArrayList names(iterationsCounter)
          c = 0;
          while(true){ // Loop to check every character and asks for a retype if detects one character as letter
              if(characterChecker.length != 8){ // Checks for a maximum length of 8 characters
                  System.out.println(&quot;A date of birth in the right format (AAAAmmdd) please...&quot;);
                  System.out.print(&quot;Reenter your date of birth again (AAAAmmdd): &quot;);
                  birth.set(iterationsCounter,input.next());
                  characterChecker = birth.get(iterationsCounter).toCharArray();
              }
              else if(Character.isLetter(characterChecker[c])){ //checkes if there are letters in the characters
                  System.out.println(&quot;A date of birth in the right format (AAAAmmdd) please...&quot;);
                  System.out.print(&quot;Reenter your date of birth again (AAAAmmdd): &quot;);
                  birth.set(iterationsCounter,input.next());
                  characterChecker = birth.get(iterationsCounter).toCharArray();
                  c = 0;
              }
              else {
                  c++;
              }
              if(c == characterChecker.length){ //breaks when c = to the length meaning all characters have been checked through the loop
  
                  break;
              }
          }
          if(birth.get(iterationsCounter).equalsIgnoreCase(&quot;stop&quot;)){ //Checks if stop has been typed, breaks in that case but erases previous ArrayLists of this cycle
              names.remove(iterationsCounter);
              birth.remove(iterationsCounter);
              break;
          }
  
          System.out.print(&quot;Enter your GPA in 0.0 format: &quot;);
          gpa.add(input.next());
          characterChecker = gpa.get(iterationsCounter).toCharArray(); //Declare and initiates an array of character from the ArrayList names(iterationsCounter)
          c = 0;
          while(true){ // Loop to check every character and asks for a retype if detects one character as letter
              if(characterChecker.length != 3){ // Checkes for a maximum length of 8 characters
                  System.out.println(&quot;A GPA in the right format please (0.0)...&quot;);
                  System.out.print(&quot;Reenter your GPA please: &quot;);
                  gpa.set(iterationsCounter,input.next());
                  characterChecker = gpa.get(iterationsCounter).toCharArray();
              }
              else if(Character.isLetter(characterChecker[c])){ //checks if there are digits in the characters
                  System.out.println(&quot;A GPA in the right format please (0.0)...&quot;);
                  System.out.print(&quot;Reenter your GPA: &quot;);
                  gpa.set(iterationsCounter,input.next());
                  characterChecker = gpa.get(iterationsCounter).toCharArray();
                  c = 0;
              }
  
              else {
                  c++;
              }
              if(c == characterChecker.length){ //breaks when c = to the length meaning all characters have been checked through the loop
  
                  break;
              }
          }
          if(gpa.get(iterationsCounter).equalsIgnoreCase(&quot;stop&quot;)){ //Checks if stop has been typed, breaks in that case but erases previous ArrayLists of this cycle
              names.remove(iterationsCounter);
              birth.remove(iterationsCounter);
              gpa.remove(iterationsCounter);
              break;
          }
          iterationsCounter++; // Incrementes the counter if a full loop is done
      }
  
      // Prints the results
      System.out.println(&quot;Number of valid inputs before you got exhausted: &quot; + iterationsCounter);
      System.out.println(&quot;====================================================================================&quot;);
  
      //A loop to print the content of the 3 ListArrays
      for(int arrayLoc = 0; arrayLoc &lt; iterationsCounter; arrayLoc++){
          System.out.println((arrayLoc+1) + &quot;-\t&quot; + names.get(arrayLoc) +
                              &quot;\t\t&quot; + birth.get(arrayLoc) +
                              &quot;\t\t&quot; + gpa.get(arrayLoc));
      }
  
  
  }
  </code></pre>
  <p>}</p>