RosettaCodeData/Task/Binary-strings/Arturo/binary-strings.arturo
2026-02-01 16:33:20 -08:00

35 lines
478 B
Text

; creation
x: "this is a string"
y: "this is another string"
z: "this is a string"
; comparison
if x = z -> print "x is z"
; assignment
z: "now this is another string too"
; copying reference
y: z
; copying value
y: new z
; check if empty
switch empty? x -> print "empty"
-> print "not empty"
; append a string
'x ++ "!"
print x
; substrings
print slice x 5 8
; join strings
z: x ++ y
print z
; replace occurrences of substring
print replace z "t" "T"