regex - Drop values between two characters in a string -
this question has answer here:
- get filename url path in r 2 answers
suppose have multiple forms of following string
x <- "/users/name/google drive/thesis/data/data x , y/uk//5port/5groups.csv" i want drop values between first / , last / return 5groups.csv. used gsub couldn't find how specify pattern.
my question same this 1 in r.
if using sub
sub('.*\\/', '', x) #[1] "5groups.csv"
Comments
Post a Comment