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.
Non-existent; I don't have TV
Non-existent; my TV doesn't have/need a remote
Under my control; I watch alone
Under the control of whoever shouts loudest
Under the control of whoever gets it first
One of many, and the TV has a mind of its own
Results (472 votes),