tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
23
Task/Copy-a-string/REBOL/copy-a-string.rebol
Normal file
23
Task/Copy-a-string/REBOL/copy-a-string.rebol
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
REBOL [
|
||||
Title: "String Copy"
|
||||
Date: 2009-12-16
|
||||
Author: oofoe
|
||||
URL: http://rosettacode.org/wiki/Copy_a_string
|
||||
]
|
||||
|
||||
x: y: "Testing."
|
||||
y/2: #"X"
|
||||
print ["Both variables reference same string:" mold x "," mold y]
|
||||
|
||||
x: "Slackeriffic!"
|
||||
print ["Now reference different strings:" mold x "," mold y]
|
||||
|
||||
y: copy x ; String copy here!
|
||||
y/3: #"X" ; Modify string.
|
||||
print ["x copied to y, then modified:" mold x "," mold y]
|
||||
|
||||
y: copy/part x 7 ; Copy only the first part of y to x.
|
||||
print ["Partial copy:" mold x "," mold y]
|
||||
|
||||
y: copy/part skip x 2 3
|
||||
print ["Partial copy from offset:" mold x "," mold y]
|
||||
Loading…
Add table
Add a link
Reference in a new issue