"Split clipboard contents and assign to variables"

Demo of how to split clipboard contents and assign the resulting individual items to variables.

Highlight the three lines below and copy them into your clipboard:

The first line of text
The second line of text
The third line of text

This is what they look like when I use the split() funtion to break them up at every line break:
{=split({clipboard}, "\n")}

What you see above (inside the square brackets) is an ordered list, which you can read more about here.

I can also choose a single item from the list, and then assign it to a variable like this (only visible in the snippet editor window):

{line1=split({clipboard}, "\n")[1]}
{line2=split({clipboard}, "\n")[2]}
{line3=split({clipboard}, "\n")[3]}

The commands above will not give any output, because they're being assigned to variables. To insert them, I need to put my variables inside my snippet like this:

{=line1}
{=line2}
{=line3}

In my split() function, I used "\n" to instruct Text Blaze that I want to split the contents at the line break. This is called a "delimiter". Other delimiters include "\t" (tab stops), alphanumeric characters and many more.

You can learn more about this here.