Language / String literals

String literals

string is Silk’s built-in UTF‑8 byte sequence type. String literals write a string value directly in source code.

Full reference: literals string.

Example: multiline text and escapes#

import std::io;

fn main () -> int {
  std::io::println(`line1
line2`);
  std::io::println("quote=\\\" backslash=\\\\");
  return 0;
}

See also#

Source repository · Edit this page · View Markdown

Quick links

Type to search across the site. Use the up and down arrow keys to choose a result, Enter to open it, and Escape to close.