title: Remove text from current cursor position to previous occurrence of space in EditText
body: <p>I want to remove text from current cursor position to previous occurrence of space in  EditText.</p>
  
  <p>Example:</p>
  
  <pre><code>                I am good at writing | articles.
  </code></pre>
  
  <p>If the above is the text in the EditText and <code>|</code> is notated as cursor position then I want to remove text 'writing' from EditText.</p>
  
  <p>Is there any best way to do so. I tried with following code</p>
  
  <pre><code>                 int in= editext.getSelectionStart();
                   String myText = editext.getText().toString();
                   String s = myText.substring(0, in);
                   //here I got problem, how to remove and set text to Exdittext
  </code></pre>