Skip to content

Latest commit

 

History

History
26 lines (19 loc) · 495 Bytes

strings.md

File metadata and controls

26 lines (19 loc) · 495 Bytes

Strings

Basics

The type of all text is the string. It is u8[], i.e. a dynamic array of 8-bit bytes, and always assumed to be utf-8.

var s = "hi äö"

Interpolation

Variables (and more complex terms) can be inserted into strings:

let i = 13
print("i has value {{i}}")

# => "i has value 13"

Some basic formatting options exists:

"bla{{pi|8.2}}"
# right-aligned, occupying 8 characters, with 2 digits after the decimal dot 
# => "bla    3.12"