Base trimws with an "inner" option that removes all spaces greater than 1 inside strings

trimws(x, which = c("both", "left", "right"), inner_space = TRUE)