! 文字列を切り取る {{category package}} {{category stringr}} > str_sub("hogehoge123", end=-3) [1] "hogehoge1" > str_sub("hogehoge123", end=-4) [1] "hogehoge" > str_sub("hogehoge123", start= -3) [1] "123"