title: How can I separate a string in Java from full name to last name, first name?
body: <p>How would you take a string that you have input from the keyboard and rearrange it? For example, in my case I am asking the user to import a person's name in "last name, first name" format. I then have to change that to "first name last name".</p>
  
  <p>Here is what I have so far:</p>
  
  <pre><code>private void setName() {
      Scanner in = new Scanner(System.in);
      System.out.println("Please enter the last name followed by the first name of" +
              "a student: ");
      name = in.nextLine();
  }
  </code></pre>