Say I have a tibble that looks like this
library(tidyverse)
df <- tibble(`var` = c(1,2), `text` = c("elephant $ more text", "cat $ some more text"))
and I would like to programmatically get all the text from the character $ to be removed, so to obtain the equivalent result of
df <- tibble(`var` = c(1,2), `text` = c("elephant ", "cat "))
I tried to use the equivalent of Removing strings after a certain character in a given text
but it seems that thee special character $ does not yield the desired outcome.