How to split a string into substrings of a given length?

Viewed 64125

I have a string such as:

"aabbccccdd"

I want to break this string into a vector of substrings of length 2 :

"aa" "bb" "cc" "cc" "dd"

5 Answers
Related