title: Android EditText/TextView how to make each word start with uppercase and all remaining characters of words to be lowercase
body: <p>I have already used following options to make each starting letter of a word Uppercase</p>
  
  <pre><code> &lt;EditText
      android:inputType="text|textCapWords"/&gt;
  </code></pre>
  
  <p>While typing the user has option on the keyboard to change the case of letter i.e. the user with this option can easily type <code>lowercase</code> letters.</p>
  
  <p>Further,I want text on my <code>EditText</code> to be on this format </p>
  
  <p><code>Each Starting Letter Of A Word Must Be In Uppercase And All Other Letter Of The Word Be In Lowercase</code>. </p>
  
  <p>Meaning,when the user inputs </p>
  
  <p><code>each StArting LeTTer of a word musT be in uppercase and all other leTTer of the word be in lowercase</code></p>
  
  <p>, it will be automatically converted to above format.</p>
  
  <p>I have tried using <code>TextWatcher</code> and <code>string.split(\\s+)</code> to get all the words and then make each and every word to follow the above format. But I always end up getting error.
  So if there is any solution,it would be great.I want this to work in the manner <code>InputFilter.AllCaps</code>.</p>
  
  <p>This is my code so far</p>
  
  <pre><code>private void changeToUpperCase(String inputString) {
      if (inputString != null &amp;&amp; inputString.trim().length() &gt; 0) {
          // businessName.addTextChangedListener(null);
          String[] splitString = inputString.split("\\s+");
          int length = splitString.length;
          StringBuffer stringBuffer = new StringBuffer();
          for (int i = 0; i &lt; length; i++) {
              String convertedString = splitString[i];
              stringBuffer.append(Character.toUpperCase(convertedString
                      .charAt(0)));
              stringBuffer.append(convertedString.substring(1).toLowerCase());
              stringBuffer.append(" ");
          }
          Log.i("changed String", stringBuffer.toString());
          // businessName.setText(stringBuffer.toString());
          stringBuffer.delete(0, stringBuffer.length());
          stringBuffer = null;
          // businessName.addTextChangedListener(this);
      }
  }
  </code></pre>
  
  <p>This function I am calling from <code>TextWatcher</code>, <code>afterTextChanged(Editable s)</code></p>