title: Remove hashtags from beginning and end of tweets in R
body: <p>I am trying to remove hashtags from beginning of strings in R.
  For example:</p>
  
  <pre><code> x&lt;- "I didn't know it could be #boring. guess I need some fun #movie #lateNightThoughts"
  </code></pre>
  
  <p>I want to remove the hashtags at the end of string which are #lateNightThoughts and #movie. Result:</p>
  
  <pre><code> - "I didn't know it could be #boring. guess I need some fun"
  </code></pre>
  
  <p>I tried :</p>
  
  <pre><code>stringi::stri_replace_last_regex(x,'#\\S+',"")
  </code></pre>
  
  <p>but it removes only the very last hashtag.</p>
  
  <pre><code>- "I didn't know it could be #boring. guess I need some fun #movie "
  </code></pre>
  
  <p>Any idea how to get the expected result?</p>
  
  <p>Edit:</p>
  
  <p>How about removing hashtag from beginning of text ?
  eg:</p>
  
  <pre><code>x&lt;- "#Thomas20 I didn't know it could be #boring. guess I need some fun #movie #lateNightThoughts"
  </code></pre>