Aug-02-2022, 05:28 PM
You may be over complicating this (or maybe I'm over simplifying it) because you could achieve the objective with a simple sting slice:
text_string = "For some reason x:is in this string" varX = "x:" index = text_string.find(varX)+len(varX) print(text_string[index:index+10])
Sig:
>>> import this
The UNIX philosophy: "Do one thing, and do it well."
"The danger of computers becoming like humans is not as great as the danger of humans becoming like computers." :~ Konrad Zuse
"Everything should be made as simple as possible, but not simpler." :~ Albert Einstein
>>> import this
The UNIX philosophy: "Do one thing, and do it well."
"The danger of computers becoming like humans is not as great as the danger of humans becoming like computers." :~ Konrad Zuse
"Everything should be made as simple as possible, but not simpler." :~ Albert Einstein