str_sub()

文字列を切り取る

[package] [stringr]

> str_sub("hogehoge123", end=-3)
[1] "hogehoge1"
> str_sub("hogehoge123", end=-4)
[1] "hogehoge"
> str_sub("hogehoge123", start= -3)
[1] "123"