From be49c6731c441c8d2ec2d2f4c0e9cc5a22b41aa1 Mon Sep 17 00:00:00 2001 From: Danny Yoo Date: Thu, 13 Dec 2012 19:05:45 -0700 Subject: [PATCH] Documentation example for string-copy. --- collects/scribblings/reference/strings.scrbl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/collects/scribblings/reference/strings.scrbl b/collects/scribblings/reference/strings.scrbl index af83e5aff5..b89708643c 100644 --- a/collects/scribblings/reference/strings.scrbl +++ b/collects/scribblings/reference/strings.scrbl @@ -101,7 +101,14 @@ Returns an immutable string with the same content as @defproc[(string-copy [str string?]) string?]{ Returns - @racket[(substring str 0)].} + @racket[(substring str 0)]. +@examples[(define s1 "Yui") + (define pilot (string-copy s1)) + (list s1 pilot) + (for ([i (in-naturals)] [ch '(#\R #\e #\i)]) + (string-set! pilot i ch)) + (list s1 pilot)] +} @defproc[(string-copy! [dest (and/c string? (not/c immutable?))]