I find myself in a situation that before I go ahead and "Just Do It" myself, are there functions that Extract, or Replace only certain occurrences of a matching string?
Reason I ask is say for simplicity, In this example I will say Replace (I will worry about Extract etc later, I just need to know if what I am about to write is reinventing the wheel or not)
Example: "blackcat, white cat ,blue cat, what is a cat?, yadda yadda"
Command to execute: Remove second occurrence of the word "cat"
Resulting string: "blackcat, white < The word CAT deleted from here >,blue cat, what is a cat?, yadda yadda"
I know it can easily be done, but just wondered if its already done? or worthwhile writing a wrapper for?
Reason I ask is say for simplicity, In this example I will say Replace (I will worry about Extract etc later, I just need to know if what I am about to write is reinventing the wheel or not)
Example: "blackcat, white cat ,blue cat, what is a cat?, yadda yadda"
Command to execute: Remove second occurrence of the word "cat"
Resulting string: "blackcat, white < The word CAT deleted from here >,blue cat, what is a cat?, yadda yadda"
I know it can easily be done, but just wondered if its already done? or worthwhile writing a wrapper for?
Comment