this is going to be silly.
I have a string like:
word <- "dirtyboards.csv"
I want to remove the csv part and get "dirtyboards".
I am trying:
require(stringr)
str_extract(word, ".*[^.csv]")
I get in return: "dirtyboard" . The "s" before the ".csv" goes missing.
I know I can do ,
gsub(".csv", "", word)
Try
Another option which works for the example provided (and not very specific)
Update
Including 'foo.csv.csv',