String
Strings are traditionally a sequence of characters, but you can think of them as "text". Cheddar's strings are like Ruby's strings.
Basic Syntax
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.
Using special characters
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.
Using formatting
"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}
Last updated