-
1
- #1
myatia
Programmer
- Nov 21, 2002
- 232
What's the easiest and most efficient way to replace only the last instance of a substring? For example, how do I change the last instance of "dog" into "cat":
before = "My dog chased this dog and that dog."
after = "My dog chased this dog and that cat."
If anyone has any suggestions, I'd really appreciate them.
Thanks!
Misty
before = "My dog chased this dog and that dog."
after = "My dog chased this dog and that cat."
If anyone has any suggestions, I'd really appreciate them.
Thanks!
Misty