This question already has an answer here:
I have some very dirty text data frame and I would like to clean it with R. I would like to know if it's possible to detect an uppercase in the middle of a string and use it to split it
For example I have a string like that
x = "This is an exampleThis is another exampleHow can I split thatOnly With uppercase in the Middle of a word"
I would like to split it by replacing every time I see an uppercase in the middle of a word by something else. For exemple, an expected result would be:
"This is an example. This is another example. How can I split that. Only With uppercase in the Middle of a word"