I have character vectors similar to this one:
test <- "ThisisAtest"
I would like to insert a ; between lowercase and uppercase characters, so that the expected output is:
"Thisis;Atest"
To do so, I need to detect the consecutive lowercase and uppercase characters. I tried to do this (I used str_remove instead str_replace because I don't know the first pattern yet):
stringr::str_remove(test, "^[a-zA-Z]*$")
but it returns an empty character vector. Does anyone know how to do this?
I don't know if there are differences between the regex used by gsub() or stringr::str_* functions but I would prefer the latter.