r - remove all words that start with "@" from a string -


how can remove words start "@" string?

for example, "@agnezmo on @airasia airbus a320-216 fleet @ninetologymy livery -- 9m-ahg cc: @agnesmonicaent @agnezone http://t.co/hfxwuqq2oq"

i have string "on airbus a320-216 fleet livery -- 9m-ahg cc: http://t.co/hfxwuqq2oq"

try s input:

gsub("@\\w+ *", "", s) 

giving:

"on airbus a320-216 fleet livery -- 9m-ahg cc: http://t.co/hfxwuqq2oq" 

Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -