I have a vector of names where some names have leading and trailing .
characters, and some do not. Here is an example:
test <- c('.name.1.','name.2','.name.3.')
I would like to conditionally remove leading and trailing .
characters in these names, to return
c('name.1','name.2','name.3')
See Question&Answers more detail:os