For the complete documentation index, see llms.txt. This page is also available as Markdown.

Strings

How to get shit done with strings

String interpolation

REDscript lets you insert any expression into a string using the s prefix. This is a convenient way to create formatted strings without using concatenation or conversions.

Log(s"My name is \(name) and I am \(year - birthYear) years old");

This is equivalent to:

Log("My name is " + name + " and I am " + ToString(year - birthYear) + " years old");

The compiler automatically converts expressions of any type other than String using ToString.

String concatenation

Via string addition overloads, you can simply use the + operator to join strings with values of different types (such as Int32 or Float) without using string conversations.

// You can use addition to combine strings with integers, floats and several other types 
Log("My name is " + name + " and I am " + (year - birthYear) + " years old");

Utility Functions

Check String Functions for helper functions with strings.

Last updated