Search a string.

Oct 27, 2021 at 5:59pm
Hi,
I need to find a string which is started from the first of the line and replace it with another string,
s1 = xxyyzz
xxyyzz = ...

s2 = ABCxxyyzzDEF
ABCxxyyzzDEF =...

s3= xxyyzzABCDEF
xxyyzzABCDEF = ...


I need to find just s1.
Although s2 and s3 are including s1, I do not need s2 or s3.
How I can write the code?
Oct 27, 2021 at 7:44pm
string has .find() and .replace() ... just call them?
if you need to replace the same block many times, you can simply loop (using find) or rig up a complex statement.
Last edited on Oct 27, 2021 at 7:46pm
Topic archived. No new replies allowed.