I am looking for a way to replace a word, however only when its not surounded by quotations.
For example
Replacing Hello
with Hi
Use the substring function find all the occurances of the word you want to replace, for each word look at one index previous to what the substring function returns and see if its a quote.
eg. ""Hello 'Hello' Nothing"
Substring function returns 0 -- so of course there is no quote Substring function returns 6 -- check string[5] -- theres a quote, look for next ocurance
How can you keep checking using the substring function? something like this:
startindex=0
while(!done):
index=substr(string, startindex)
if(str[index-1] == "'")
startindex=index
continue
from here you'll figure it out