Strings
How to get shit done with strings
For how to enable logging, please see Logging
If you want to use strings for localization, check Utilities -> Localization
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