title: How to split a String from a list in dart
body: <p>I'm trying to sort some data in a <code>List&lt;String&gt;</code>. I want to split a long <code>String</code> of every other item and delete part of it. Data will be added to the list when the user performs an action. </p>
  
  <p>Example of what could be in the list:</p>
  
  <p>NOTE* These are not separate items in the list. Its all one <code>String</code>.</p>
  
  <blockquote>
    <p>"Cat walked across the road"</p>
  </blockquote>
  
  <p>What I want from this String is just:</p>
  
  <blockquote>
    <p>"Cat"</p>
  </blockquote>
  
  <p>Currently, I've initialised the list and split the <code>String</code> as shown below.</p>
  
  <pre><code>//Initialised List
   List&lt;String&gt; list = [];
  
  //Method to split and delete String
  String handleString(String items){
  
  //Splits String
      items.split(" ").toString();
  
  //TODO Delete String 
  
  }
  </code></pre>
  
  <p>Output of this code looks like this:</p>
  
  <blockquote>
    <p>Cat, walked, across, the, road</p>
  </blockquote>
  
  <p>The code below gets a single item from the list using <code>.text</code> get method.</p>
  
  <pre><code>for(var txt in list){
       String sentenceInList  = txt.text
  print(txt.text);
  
  
  }
  </code></pre>
  
  <p>Output :</p>
  
  <blockquote>
    <p>Cat walked across the road</p>
  </blockquote>
  
  <p>Im not sure how to remove everything except the first word of every other potential item in the list?</p>
  
  <p>Im looking to start at item one so if the items were as shown below, it would look like this:</p>
  
  <p>Item 1: "Cat walked across the road"</p>
  
  <blockquote>
    <p>Output: Cat</p>
  </blockquote>
  
  <p>Item 2: How are you today</p>
  
  <blockquote>
    <p>How are you today</p>
  </blockquote>
  
  <p>and so on...</p>
  
  <p>If anyone is able to help with this, it would be most appreciated?</p>