Quantcast
Channel: Active questions tagged r - Stack Overflow
Viewing all articles
Browse latest Browse all 205343

R regex split when upper case found in middle of the word [duplicate]

$
0
0

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"

Viewing all articles
Browse latest Browse all 205343

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>