Strings in Trillium

Strings are some of the most widely used variable types in almost all programming languages.


Below will show you how strings are handled in Trillium and how you can define strings.

Declaring Strings


Below will show you how to declare strings




Above you can see that you first create a string variable by defining 'var a' and setting it equal to "string A". You can also define a string implicitly by using the ' : string ' nomenclature.

Using Strings


Strings can be used to just define something and return that value, or they can have different operators applied to them. Below are some examples of that.




You can see above some common uses for strings in Trillium. Of course this is a basic example and other use cases exist.

Casting to a string


Sometimes strings on their own can't do certain things like arithmetic and other boolean operators like greater than, so you have to handle those in another format and then cast them to a string. Below is an example of this.




If you pass the number 1337 as an integer to our method above it will return a string value of '1337'

An error has occurred. This application may no longer respond until reloaded. Reload 🗙