Strings: Making strings
● Beginner3 min
Plain strings, multi-line strings in triple quotes, and raw strings that take every character as written.
fn main() {
const poem = """
Roses are red,
violets are blue
"""
print(poem)
print(r"C:\users\{name}")
print("Tab:\tdone")
print("She said \"hi\"")
}The program ran and printed:
kavach run make.kav
Roses are red, violets are blueC:\users\{name}Tab: doneShe said "hi"
""" … """holds several lines. The indentation they share is removed, so the text can sit neatly in your code.r"…"is raw: a backslash or a brace is just a character. Handy for Windows paths.- In a plain string,
\tis a tab,\na new line,\"a quote.