Some fields had extra quotes around them (e.g. "10/18/2012") or extra spaces before and after the field (e.g. " Yes") that I want to remove. I wrote a function (see below)
Code: Select all
function removeSpaces x
replace quote & quote with " " in x
repeat while char 1 of x = " "
put length(x) into y
put char 2 to y of x into x
end repeat
repeat while char -1 of x = " "
put length(x) into y
put char 1 to y of x into x
end repeat
return x
end removeSpaces
I tried using replaceText but I had trouble with the quote (") - even backslashing it did not work.
Code: Select all
replaceText(x,"\"","")
LiveCode is so powerful, it just seems like I am doing everything by brute force. Are there more elegant ways to accomplish what I am trying to do?
Thank you in advance...