Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
14
Task/Copy-a-string/Racket/copy-a-string.rkt
Normal file
14
Task/Copy-a-string/Racket/copy-a-string.rkt
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#lang racket
|
||||
|
||||
(let* ([s1 "Hey"]
|
||||
[s2 s1]
|
||||
[s3 (string-copy s1)]
|
||||
[s4 s3])
|
||||
(printf "s1 and s2 refer to ~a strings\n"
|
||||
(if (eq? s1 s2) "the same" "different")) ; same
|
||||
(printf "s1 and s3 refer to ~a strings\n"
|
||||
(if (eq? s1 s3) "the same" "different")) ; different
|
||||
(printf "s3 and s4 refer to ~a strings\n"
|
||||
(if (eq? s3 s4) "the same" "different")) ; same
|
||||
(string-fill! s3 #\!)
|
||||
(printf "~a~a~a~a\n" s1 s2 s3 s4)) ; outputs "HeyHey!!!!!!"
|
||||
Loading…
Add table
Add a link
Reference in a new issue