IndexError: list index out of range, substring from string

Question:

I have a function for extacting a substring from a string.

And it returns the correct result.

Asked By: mightycode Newton

||

Answers:

Oke, this works:

    print(allSubstring[0]) if len(allSubstring) > 0 else 'null'
Answered By: mightycode Newton
Categories: questions Tags:
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.