Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Answer: How do I replace a substring (if exists) with a different substring in a string?

( #98358=categorized answer: print w/ replies, xml ) Need Help??

Q&A > strings > How do I replace a substring (if exists) with a different substring in a string? contributed by davorg

With appropriate use of index, length and substr.

And remember that substr can be used as an lvalue.

Comment on Answer: How do I replace a substring (if exists) with a different substring in a string?
Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (10)
As of 2014-07-28 20:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (209 votes), past polls