I want to know if there's any way that we can print text starting from a specific character to a specific character. (both are not same)
The conditions:
- There are multiple instances of start character, so i just want the first instances index to be
start index. - The start index and end index are not same, for example "0" is start index and "()" is the end index.
- Also there might be multiple instances of the start character.
What have I tried?:
- I have tried string slicing
a="ahklanfatga0-gja0-gmgaf9hatn.pdfkaufs"
indexes=[i for i,j in enumerate(a) if j=="-"]
but I have a different start character and end character, so this doesn't work.
For example:
a3="ahklanfatga0-gja0-gmgaf9hatn.pdfkaufs" # start char="-", end char=".pdf"
expected_output="gja0-gmgaf9hatn.pdf"