I would just add the htm then after splitting as str.split removes the delimiter. You need to add a portion of it back. There are a number of ways to do that
If you want to add a colon:
>>> [f'{e}html' for e in s.split('html') if e][0] 'JKl:TOGGLE:HJAK.html'
(Sep-11-2019, 10:58 AM)SriRajesh Wrote: :JKl:TOGGLE:HJAK.htmWhere is the first colon coming from as that is not in the original string?
If you want to add a colon:
>>> [f':{e}html' for e in s.split('html') if e][0] ':JKl:TOGGLE:HJAK.html'or remove l from html
>>> [f':{e}html' for e in s.split('html') if e][0][:-1] ':JKl:TOGGLE:HJAK.htm'NOTE: my response is using f-strings from python3.6
Recommended Tutorials: