<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Save text with line breaks]]></title><description><![CDATA[<p>Maybe someone finds this useful.</p>
<p>I managed to save larger lines of text in the data array actor, even with line brakes.</p>
<p>I wrote a very small java script, changing line breaks to some unusual symbols. A second script recovers the breaks from the recalled data.<br /><br />This is the 'encryption':</p>
<pre>
function main()
{
var text = arguments[0];
var txt = text.replace(/(?:\r\n|\r|\n)/g, '"-&gt;"');
return txt;
}</pre>
<p>And this the decryption:</p>
<pre>
function main()
{
var text = arguments[0];
var txt = text.replace(/"-&gt;"/g, '\r\n');
return txt;
}</pre>
<p>.</p>
<p>PS: Writing this lines, it comes to my mind again, that it would be great to have a &lt;code&gt; function for the forum to visually separate java and shader scripts.</p>]]></description><link>https://community.troikatronix.com/topic/5424/save-text-with-line-breaks</link><generator>RSS for Node</generator><lastBuildDate>Sun, 08 Mar 2026 10:42:48 GMT</lastBuildDate><atom:link href="https://community.troikatronix.com/topic/5424.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 01 Sep 2018 18:53:33 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Save text with line breaks on Sun, 02 Sep 2018 08:04:55 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://community.troikatronix.com/uid/740">@dillthekraut</a></p><p>You do have a &lt;code&gt; function for the forum. </p><img src="/assets/uploads/files/1535875493432-codefunction.png" />]]></description><link>https://community.troikatronix.com/post/31778</link><guid isPermaLink="true">https://community.troikatronix.com/post/31778</guid><dc:creator><![CDATA[Michel]]></dc:creator><pubDate>Sun, 02 Sep 2018 08:04:55 GMT</pubDate></item><item><title><![CDATA[Reply to Save text with line breaks on Sat, 01 Sep 2018 20:09:38 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://community.troikatronix.com/uid/740">@dillthekraut</a></p><p>Clever solution. I like it.</p>]]></description><link>https://community.troikatronix.com/post/31775</link><guid isPermaLink="true">https://community.troikatronix.com/post/31775</guid><dc:creator><![CDATA[DusX]]></dc:creator><pubDate>Sat, 01 Sep 2018 20:09:38 GMT</pubDate></item></channel></rss>