Working with strings
Join two pieces of text in the order you want them to appear.
Simple example
Join two letters.
StartA + B
ResultAB
def main() raises:
var line = String("A") + "B"
print(line)
AB
Advertisements
Everyday examples
A shelf label starts with the aisle letter and ends with the shelf number. Make the label for shelf 12 in aisle C.
StartC + 12
ResultC12
def main() raises:
var line = String("C") + "12"
print(line)
C12