Is there a Python-way to split a string after the nth occurrence of a given delimiter?
Given a string:
\'20_231_myString_234\'
It s
>>> n = 2 >>> groups = text.split('_') >>> '_'.join(groups[:n]), '_'.join(groups[n:]) ('20_231', 'myString_234')
Seems like this is the most readable way, the alternative is regex)