title: Insert newline character after specific number of words
body: <p>I want to insert a new line character(\n) after 9 words in my string such that the string after the 9th word is in next line.</p>
  
  <p>string newline="How to insert newline character after ninth word of(here) the string such that the remaining string is in next line"</p>
  
  <p>Stucked here:</p>
  
  <pre><code>foreach (char x in newline)
  {
      if (space &lt; 8)
      {                    
          if (x == ' ')
          {
              space++;
          }
      }
  
  }
  </code></pre>
  
  <p>Don't know why I got stucked. Its quite simple I know.<br>
  If possible, show any other simple method.</p>
  
  <p>Thank you!</p>
  
  <p><strong>Note: Found an answer for myself. Given by me below.</strong></p>