By this point in the tutorial you should be familiar with all the keywords you need to know for this section, so we are going to go through these three commands quickly.

Swap

The swap command will swap one section of text in the input with another section.

Hello world!>> swap first "world!" with first "Hello"world! Hello

Unlike the previous commands, you cannot use multiple instances with these three commands. The following instances are valid:

firstlastinst 1

The following instances are not valid:

 everyinst 1, 3, 5

Either side of the with can either be a text, character position, or a span. You can use the regex and xcase modifiers with all of these three commands.

first regex xcase "foo"char 1everything from pos 0 to pos 2

Documentation

More information on the swap command can be found on the documentation page.

Shift

The shift command is used to shift selected text from one part of the input to another part.

Hello world!>> shift first "world!" to pos 0world! Hello

Just like with the swap command, the left side of the command can either be a text, character index, or a span.

first regex xcase "foo"char 1everything from pos 0 to pos 2

The right side of the command can either be a position or a before/after.

pos 0before first "foo"before char 1

Documentation

More information on the shift command can be found on the documentation page.

Copy

The copy command behaves exactly the same as the shift command, only instead of shifting text to another position, you will be copying the text.

Hello world!>> copy first "world!" to pos 0world! Hello world!

Documentation

More information on the copy command can be found on the documentation page.

Test your knowledge

Next up, there will be a short quiz to make sure you understand everything you have learnt in part 2.4. If you do not wish to take this test, click skip quiz.