[issue39045] Segmentation of string

Lovi report at bugs.python.org
Sat Dec 14 02:54:44 EST 2019


New submission from Lovi <1668151593 at qq.com>:

I thought for a long time. 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.

For example:

segment('1234', m=3) -> [('1', '2', '34'), ('1', '23', '4'), ('12', '3', '4')]
segment('12345', m=3) -> [('1', '2', '345'), ('1', '23', '45'), ('1', '234', '5'), ('12', '3', '45'), ('12', '34', '5'), ('123', '4', '5')]


I hope this proposal can be adopted.

----------
components: Library (Lib)
messages: 358383
nosy: lovi
priority: normal
severity: normal
status: open
title: Segmentation of string
type: enhancement
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39045>
_______________________________________


More information about the Python-bugs-list mailing list