Given I want to insert a space after every third character in a string, except for after the last one.
This is how far I got:
re.sub('(.{3})','\\1 ',i)
But I didn't find an elegant way to skip the last insert, for cases where len(i)%3=0
.
Any idea?
re.sub('(.{3})$-','\\1 ',i)
does not help at all.
Thanks