smfiles writes:
> I think it's necessary to add a segment() method to str type or
> string module. This method is used to split a string into m parts
> and return all cases. With segment(), you can avoid tedious
> calculation and indexing if you want to segment a string.
In addition to David
I think it's necessary to add a segment() method to str type or string module.
This method is used to split a string into m parts and return all cases. With
segment(), you can avoid tedious calculation and indexing if you want to
segment a string.
For example:
segment('1234', m=3) -> [('1', '2