Let\'s say I have a long character string: pneumonoultramicroscopicsilicovolcanoconiosis. I\'d like to use stringr::str_replace_all to replace certain letters w
stringr::str_replace_all
There is probably an order in what the function does, so after replacing all c by s, you replace all s by c, only c remains .. try this :
long_string %>% str_replace_all(c(c ="X", s = "U")) %>% str_replace_all(c(X ="s", U = "c"))