title: Java String function help needed
body: <p>I have a homework question from college that I am having trouble with and I was wondering if anyone could give me some advice on where to go with it. We are using Arrays, for loops, if else and Strings.</p>
  
  <p>I have to create a programme to take in a number of peoples names then put them in an Array ( which I had no problem with) I then need to separate the names in the array according to the first letters of each name : A-G in one array, letters H-P in another and the rest in a final array. </p>
  
  <p>I have been told to use a String Function for this but not to use lists or Char. 
  This is the code I have so far :</p>
  
  <pre><code>import java.util.Scanner;
  
  public class Party {
  
  /**
   * @param args the command line arguments
   */
  public static void main(String[] args) 
  {
     Scanner sc = new Scanner(System.in); // declaring scanner
  
     int numGuests; // declaring the variable for number of guests
      System.out.println("please enter the number of guests you are hosting : ");
      numGuests = sc.nextInt(); // scanner for user inout num of guests
  
      String[] names = new String[numGuests]; // string for number of guests
  
      System.out.println("Please enter names "); 
  
      for(int i = 0; i &lt; names.length; i++) // for loop for inputing the names.
      {
          names[i] = sc.next();
      }
  }    
  }
  </code></pre>