hello guys... i have a bit of a problem with my assignment im working on :(
what the problem is there is a function which accepts a string, a keyword and an array of keywords to replace the keyword occurrences with
for eg, def function(text, keyword, keyword_list):
and for eg, the text that is passed might have an occurance of TEST in there 4 times ('TEST TEST TEST TEST'). and the keyword_list might be "". and it needs to replace the first instance of TEST in the string with the first keyword (keyword_list[0]) in the list. second with the second (keyword_list[1]) and all remaining instances with (keyword_list[2])
so the outcome from 'TEST TEST TEST TEST' would be 'TEST_1 TEST_2 TEST_3 TEST_3'
i have no idea where to start with it :? string.find() and string.replace() wont work as it will replace all instances of TEST with one swift go. and i only want to replace the first.
thanks in advance! im really stuck :(