[Python-ideas] Segmentation of string

2019-12-14 Thread Stephen J. Turnbull
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

[Python-ideas] Segmentation of string

2019-12-14 Thread smfiles
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