Keeping part of a string in R
Use strsplit(). 

If you want to remove the space between the two words (along with 'NSW'):

city_clean &lt;- unlist(c(strsplit(city, " NSW")))

Output: [1] "Sydney"      "Newcastle"   "Liverpool"   "Broken Hill"

It wasn't clear to me whether you wanted to keep the space or not. If you want to keep the trailing space after the city name

city_clean &lt;- unlist(c(strsplit(city, "NSW")))

Output: [1] "Sydney "      "Newcastle "   "Liverpool "   "Broken Hill "

If you prefer to use regex, here's another solution:

city_clean &lt;- gsub(" NSW", "", city)

Output: [1] "Sydney"      "Newcastle"   "Liverpool"   "Broken Hill"