I got a string that sometime will have instance of
This is Hello World Hello Thanks
Notice that Hello was repeat twice, I would like to replace the first "occurence" of Hello and Make it as
This is World Hello Thanks
Is there a way I can check if there is a word is repeat twice, and to remove the first occurence and get the final string.
The only I could think of is using explode, and get each word by delimiter "white space".
And then I not sure how to proceed on like counting occurance and removing the repeated word.
Thanks for helping