I am looking for a way to replace all _
(by say ''
) in each of the following characters
x <- c('test_(match)','test_xMatchToo','test_a','test_b')
if and only if _
is followed by (
or x
. So the output wanted is:
x <- c('test(match)','testxMatchToo','test_a','test_b')
How can this be done (using any package is fine)?