char_vec <- c("A","A B","123?")append <- "_APPEND"gsub("([[:alpha:]])", paste0("\\1", append), char_vec)
Standard input is empty
[1] "A_APPEND" "A_APPEND B_APPEND" "123?"
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!