String
Last updated
Was this helpful?
Last updated
Was this helpful?
Strings are traditionally a sequence of characters, but you can think of them as "text". Cheddar's strings are like 's strings.
Strings in Cheddar are delimited by double quotes or single quotes. Additionally, Cheddar supports literal newlines within Strings.
Whichever quote you use is your choice and varies based on your personal preference. For the rest of this documentation, double quotes will be used.
Cheddar is, again, like the C language in respect to escaping. You can use a backslash before a character to insert it's literal form rather than it to have a special meaning.
"String formatting" is a way to insert the result of an expression directly into a string. Using #{ ... }
you can "format" a string.
Backslashes also work to escape formatting:
This evaluates to: 2+2=#{2+2}