title: Split Strings based on white spaces
body: <p>(The title may be misleading. I always though the hard part is finding the proper title :D)</p>
  
  <p>Well, sentences are just (long) strings. I want to display these sentences but in a reversed way. Example: <code>"StackOverflow is a community of awesome programmers"</code> would become <code>"programmers awesome of community a is StackOverflow"</code>.</p>
  
  <p>So my idea is to have a delimiter, here a <strong><em>blank space</em></strong>. Whenever texts are entered and the space bar pressed, save that word in a list, an ArrayList and then just display them in inverted order in a textView.</p>
  
  <p>So far i can only output texts but without blank spaces (<code>programmersawesomeofcommunityaisStackOverflow</code>) and only using a button. I use the below code to do that:</p>
  
  <pre><code>@Override
          public void onClick(View v) {
              String[] sentence = input.getText().toString().split(" "); //This split() method is the culprit!
              ArrayList&lt;String&gt; wordArray = new ArrayList&lt;&gt;();
              for (String word : sentence) {
                      wordArray.add(word);
              }
              Collections.sort(wordArray);
              StringBuilder invertedSentence = new StringBuilder();
              for (int i = wordArray.size(); i &gt; 0; i--) {
                  invertedSentence.append(wordArray.get(i - 1));
              }
              output.setText(invertedSentence.toString());
          }
      });
  </code></pre>
  
  <p>How can I have a sentence be saved (automatically) in a list as split words when the system detect a white space? And add blank spaces in the output sentences? </p>
  
  <p>Thanks for your time.</p>