<cfset string = '11/12/2003, "bob", "this is a ,comma,list","end"'>
<cfscript>
string = string & ",";
first = find('"', string);
second = find('"', string, first + 1);
while(first and second)
{
string = left(string, first) & replace(mid(string, first + 1,
second-first), ',', '~', "all") & right(string, len(string) - second);
first = find('"', string, second + 1);
second = find('"', string, first + 1);
}
</cfscript>
You'll notice that I append a comma to the end of the list. This is so
that a double-quote can't be the last character. Sine CF ignores empty
list entries, this shouldn't affect the rest of your code. If it does,
just strip the last character at the end of the script.
HTH.
--Ben Doom
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

