<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">This could be a simple solution: </div><div class=""><br class=""></div><div class="">Starting each line with a special token.</div><div class=""><br class=""></div><div class="">In the example here it is the \\ double-backslash . </div><div class="">when the \\ appears in the first two columns of a source line, </div><div class="">this tells the compiler that it is a data line and that more might follow.</div><div class="">the last line starting with \\ completes the data entry.</div><div class=""><br class=""></div><div class="">Here is an example of a string declaration with some XML</div><div class="">(no escape sequences needed for “) </div><div class="">Of course it could be anything other kind of textual data as well.</div><div class=""><br class=""></div><div class="">let str = <div class=""><div style="text-align: justify;" class=""><font face="Open Sans, Arial, sans-serif" class="">\\<!DOCTYPE html></font></div><div style="text-align: justify;" class=""><font face="Open Sans, Arial, sans-serif" class="">\\<html></font></div><div style="text-align: justify;" class=""><font face="Open Sans, Arial, sans-serif" class="">\\<body></font></div><div style="text-align: justify;" class=""><font face="Open Sans, Arial, sans-serif" class="">\\</font></div><div style="text-align: justify;" class=""><font face="Open Sans, Arial, sans-serif" class="">\\<h1>W3Schools Internal Note</h1>\n</font></div><div style="text-align: justify;" class=""><font face="Open Sans, Arial, sans-serif" class="">\\<div></font></div><div style="text-align: justify;" class=""><font face="Open Sans, Arial, sans-serif" class="">\\<b>To:</b> <span id="to"></span><br>\n</font></div><div style="text-align: justify;" class=""><font face="Open Sans, Arial, sans-serif" class="">\\<b>From:</b> <span id="from"></span><br>\n</font></div><div style="text-align: justify;" class=""><font face="Open Sans, Arial, sans-serif" class="">\\<b>Message:</b> <span id="message"></span></font></div><div style="text-align: justify;" class=""><font face="Open Sans, Arial, sans-serif" class="">\\</div></font></div><div style="text-align: justify;" class=""><font face="Open Sans, Arial, sans-serif" class="">\\\n</font></div><div style="text-align: justify;" class=""><font face="Open Sans, Arial, sans-serif" class="">\\<script></font></div><div style="text-align: justify;" class=""><font face="Open Sans, Arial, sans-serif" class=""><a href="smb://var" class="">\\var</a> txt, parser, xmlDoc;</font></div><div style="text-align: justify;" class=""><font face="Open Sans, Arial, sans-serif" class=""><a href="smb://txt" class="">\\txt</a> = "<note>" +</font></div><div style="text-align: justify;" class=""><font face="Open Sans, Arial, sans-serif" class="">\\"<to>Tove</to>" +</font></div><div style="text-align: justify;" class=""><font face="Open Sans, Arial, sans-serif" class=""><a href="smb://etc" class="">\\etc</a>. this is the last data line.</font></div></div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Conditions: </div><div class=""><br class=""></div><div class="">- Every line starting with \\ in first and second column of the line </div><div class=""> is treated as a data line.</div><div class="">- All characters behind the \\ are regarded as data, thus note that:</div><div class=""> - the “ is not regarded as a string delimiter</div><div class=""> - the // chars and whatever follows it are interpreted as data on such a line, not as comment.</div><div class=""> - \\ within the data itself are treated as data e.g. this line is valid:</div><div class=""><a href="smb://There" class="">\\There</a> \\ are three backslashes (as data) in this line \\\\ today.</div><div class="">\\</div><div class="">the above data line is empty but is allowed. </div><div class=""><div class=""><br class=""></div><div class="">- Leading and embedded spaces are respected.</div><div class="">- Tabs, Linefeeds etc. can be inserted the usual way using \t \n etc. </div></div><div class=""><div class="">- trailing spaces and line terminators cr lf are ignored, filtered out.</div></div><div class=""><br class=""></div><div class="">let dutchNumbers = </div><div class="">\\ een twee drie vier vijf</div><div class=""><br class=""></div><div class="">\\ zes zeven acht negen tien </div><div class=""><a href="smb://these" class="">\\these</a> two data lines are orphans,</div><div class=""><br class=""></div><div class="">Blank lines or other Swift statement lines in-between</div><div class="">breaks a set of \\ data lines </div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><div class="">All \\ lines together are treated as one single string literal</div><div class="">and may occur everywhere where “normal” string literals are allowed.</div><div class=""><br class=""></div><div class=""> // E.g. this if statement would be correct:</div><div class=""> // Yes, this would be legal but doesn’t look so great: Indentation not possible here</div><div class=""> if cars == </div><div class=""><a href="smb://Ford" class="">\\Ford</a></div><div class="">\\ Delorean</div><div class="">\\ Chevrolet</div><div class=""> {</div><div class=""> doSomething()</div><div class=""> }</div></div><div class=""><br class=""></div><div class="">An array with 2 string elements: </div><div class=""><br class=""></div><div class="">var ar =</div><div class="">[ </div><div class=""><a href="smb://sdkdslkdslkdsldkshfkjdljfsdljkfdshjklfd" class="">\\sdkdslkdslkdsldkshfkjdljfsdljkfdshjklfd</a> dioioioioio \n\nsljkf sdflkf dsl;dfsk sdlfk dfsfkds </div><div class="">\\ sdkdfkdfldkfd fdfldk fdlkfd jkfds hjklfd dsljkf sdflkf dsl;dfsk sdlfk dfsfkds </div><div class="">,</div><div class=""><a href="smb://There" class="">\\There</a> are many ships in the ha</div><div class=""><a href="smb://rbour" class="">\\rbour</a> that are soon sailing away.</div><div class="">]</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">I also thought about using “” as token, but this would be interpreted as an empty string.</div><div class="">or “”” but this is an empty string followed by an unclosed string literal.</div><div class=""><br class=""></div><div class="">Should be relatively easy to implement? What y’all think?</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Kind Regards</div><div class="">TedvG</div></body></html>