I am using rvest
to parse a website. I\'m hitting a wall with these little non-breaking spaces. How does one remove the whitespace that is created by the
jdharrison answered:
gsub("\\W", "", bodytext)
and, that will work but you can use:
gsub("[[:space:]]", "", bodytext)
which will remove all Space characters: tab, newline, vertical tab, form feed, carriage return, space and possibly other locale-dependent characters
. It's a very readable alternative to other, cryptic regex classes.