x <- c("11 846.4 A", "6 529.2 A", "3 282.7 A") gsub("(*UCP)\\s+", "", x, perl=TRUE)
Standard input is empty
[1] "11846.4A" "6529.2A" "3282.7A"
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!