I have following promotion String in my application.
String promotion = "Watch on youtube: Mickey en de stomende drol! Watch on youtube.";
I want to replace the second word 'Youtube' by the hyperlink, so I tried:
promotion = promotion.replace("youtube","https://www.youtube.com/watch?v=a3leCIk2eyQ");
But this replaces the first youtube, and I want the second youtube to be replaced.
I also tried:
promotion = promotion.replaceAll("youtube","https://www.youtube.com/watch?v=a3leCIk2eyQ");
But this replaces both youtubes.
What is the best approach to replace the second occurance of "youtube" by the linK?