📅  最后修改于: 2022-03-11 14:51:59.885000             🧑  作者: Mango
char_array = c("foo_bar","bar_foo","apple","beer")
a = data.frame("data"=char_array,"data2"=1:4)
a$data = substr(a$data,1,nchar(a$data)-3)