Using
strsplit("(1)+(2)", "\\+")
or
strsplit("(1)+(2)", "+", fixed = TRUE)
The idea of โโusing strsplit("(1)+(2)", "+")does not work, because unless otherwise specified, the argument splitis a regular expression, and the character +is special in regex. Other characters who also need special care,
source
share