# NOT RUN {
path <- "this/is/my/fileofinterest.csv"
str_start(path, "/")
path <- "this//is//my//fileofinterest.csv"
str_start(path, "//")
str_end(path, "//")
x <- c("my_friend_likes me", "your_friend likes_you")
str_start(x, "_")
# pattern "likes" starts at position 11 in first, and
# position 13 in second string
str_start(x, "likes")
# pattern "likes" ends at position 15 in first, and
# position 17 in second string
str_end(x, "likes")
x <- c("I like to move it, move it", "You like to move it")
str_start(x, "move")
str_end(x, "move")
# }
Run the code above in your browser using DataLab