I know this seems to be very complicated but what i mean is for example i have a string
This is a text string
I want to search for a string (for example: text) . I want to find first occurance of this string which comes after a given another string (for example : is) and the replacement should be another string given (for example: replace)
So the result should be:
This is a textreplace string
If text is This text is a text string
then the result should be This text is a textreplace string
I need a method (extension method is appreciated):
public static string AppendFirstOccurranceAfter(this string originalText, string after, string oldValue, string newValue)
// "This is a text string".ReplaceFirstOccurranceAfter("is", "text", "replace")