I have a string (without spaces) which I need to split into a list with items of equal length. I'm aware of the split()
method, but as far as I'm aware this only splits via spaces and not via length.
What I want to do is something like this:
string = "abcdefghijklmnopqrstuvwx"
string = string.Split(0 - 3)
print(string)
>>> ["abcd", "efgh", "ijkl", "mnop", "qrst", "uvwx"]
I have thought about looping through the list but I was wondering if there was a simpler solution?