Use the substring function to find all occurrences of the word that you want to replace, for each word look at one index preceding what the substring function returns and see if there is a quote.
eg. Hello. Hello. Nothing.
The substring function returns 0 - so, of course, there is no quotation The substring function returns 6 - the check string [5] - theres quote, look for the following ocurance
How can you continue checking with a substring function? something like that:
startindex=0
while(!done):
index=substr(string, startindex)
if(str[index-1] == "'")
startindex=index
continue
from here you will understand it
source
share