Page 2 of 2

Re: SplitString to list or array with option double-quotes (CSV)

Posted: Sat Mar 16, 2024 3:06 pm
by Tenaja
ChrisR wrote: Thu Nov 10, 2022 10:32 pm I get it, no worries and sorry for the inconvenience, i don't want to spam your thread. I don't understand in a first reading why you use (Just get it, to get around the PB syntax):

Code: Select all

text.s = "0;1x;2xx;'Text with separator (;)';4xxxx;5xxxxx;'Text with linefeed " + #LF$ + "and separator (;)';End"
text = ReplaceString(text, "'", #DQUOTE$)
I can't speak for the original author, but this technique can come in handy to build a string containing double quotes, while keeping it readable in a way that pb doesn't allow. Otherwise, in PB, to include a double quote, you have to use the + #DQUOTE$ + symbol set throughout, and readability is killed.

Re: SplitString to list or array with option double-quotes (CSV)

Posted: Sat Mar 16, 2024 3:33 pm
by mk-soft
I could also have written it as a literal string. But it was relatively new at the time.

Code: Select all

text.s = ~"0;1x;2xx;\"Text with separator (;)\";4xxxx;5xxxxx;\"Text with linefeed\nand separator (;)\";End"
But I don't find it any more readable. The first and last dquote should have a different colour.