title: Having an issue with formatting a String input
body: <p>I'm trying to get the input that the user enters to go to lower-case and then put the first character in the input to upper-case. For example, If I enter aRseNAL for my first input, I want to format the input so that it will put "Arsenal" into the data.txt file, I'm also wondering if there's a way to put each first character to upper-case if there's more than one word for a team ie. mAN uNiTeD formatted to Man United to be written to the file.</p>
  
  <p>The code I have below is what i tried and I cannot get it to work. Any advice or help would be appreciated.</p>
  
  <pre><code>import java.io.*;
  import javax.swing.*;
  public class write
  {
      public static void main(String[] args) throws IOException
      {
          FileWriter aFileWriter = new FileWriter("data.txt");
          PrintWriter out = new PrintWriter(aFileWriter);
          String team = "";
          for(int i = 1; i &lt;= 5; i++)
          {
              boolean isTeam = true;
              while(isTeam)
              {
                  team = JOptionPane.showInputDialog(null, "Enter a team: ");
                  if(team == null || team.equals(""))
                      JOptionPane.showMessageDialog(null, "Please enter a team.");
                  else
                      isTeam = false;
              }
              team.toLowerCase();                 //Put everything to lower-case.
              team.substring(0,1).toUpperCase();  //Put the first character to upper-case.
              out.println(i + "," + team);
          }
          out.close();
          aFileWriter.close();
      }
  }
  </code></pre>