Question
Replacing quotes using ReplaceList
I'm trying to search a string to replace single quotes(') and
double quotes(") with \' and " respectively using the
ReplaceList function. However, the syntax for the function uses
quotes, so the quotes are being interpreted as delimiting my syntax
rather than as the object of my search/replace.
Again, I want to replace ' with '\
and " with "
What I tried was ReplaceList(MyVariable, """, '", "", \'", "ALL")#')
I can overcome this with two separate replace functions, such as:
#Replace(MyVariable, """", """, "ALL")# and
#Replace(MyVariable, "'", "\'", "ALL")#
However, I feel like I'm cheating because I couldn't figure out how to do it in one command using ReplaceList. Programers, I'm sure you understand! 🙂 Can anyone tip me off as to how to make it work with ReplaceList?
Again, I want to replace ' with '\
and " with "
What I tried was ReplaceList(MyVariable, """, '", "", \'", "ALL")#')
I can overcome this with two separate replace functions, such as:
#Replace(MyVariable, """", """, "ALL")# and
#Replace(MyVariable, "'", "\'", "ALL")#
However, I feel like I'm cheating because I couldn't figure out how to do it in one command using ReplaceList. Programers, I'm sure you understand! 🙂 Can anyone tip me off as to how to make it work with ReplaceList?
