Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
35
Task/Binary-strings/Arturo/binary-strings.arturo
Normal file
35
Task/Binary-strings/Arturo/binary-strings.arturo
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
; 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
|
||||
if? empty? x -> print "empty"
|
||||
else -> 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"
|
||||
Loading…
Add table
Add a link
Reference in a new issue