good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: How do I replace a substring (if exists) with a different substring in a string?by dkubb (Deacon) |
on Jul 20, 2001 at 22:56 UTC ( [id://98499]=note: print w/replies, xml ) | Need Help?? |
You can use substr, length, and index inside a while loop to do what you want:
IMHO you can't beat the following for readability:
In Section
Seekers of Perl Wisdom
|
|