string-copy! -- r7rs Definition mutator!;
string-copy! (from vonuvoli);Procedure variants:
(((source string) (source-start range-start) (destination string)) -> (undefined))
source of type string;source-start of type range-start;destination of type string;undefined;(((source string) (source-start range-start) (destination string) (destination-start range-start)) -> (undefined))
source of type string;source-start of type range-start;destination of type string;destination-start of type range-start;undefined;(((source string) (source-start range-start) (destination string) (destination-start range-start) (destination-end range-end)) -> (undefined))
source of type string;source-start of type range-start;destination of type string;destination-start of type range-start;destination-end of type range-end;undefined;scheme:base -- (scheme base);scheme -- (scheme);(string-copy! to at from) (string-copy! to at from start) (string-copy! to at from start end)Domain: It is an error if
atis less than zero or greater than the length ofto. It is also an error if(- (string-length to) at)is less than(- end start).Copies the characters of string
frombetweenstartandendto stringto, starting atat. The order in which characters are copied is unspecified, except that if the source and destination overlap, copying takes place as if the source is first copied into a temporary string and then into the destination. This can be achieved without allocating storage by making sure to copy in the correct direction in such circumstances.(define a "12345") (define b (string-copy "abcde")) (string-copy! b 1 a 0 2) b ===> "a12de"
The text herein was sourced and adapted as described in the "R7RS attribution of various text snippets" appendix.