(guile.info.gz) SRFI-13 Replicate/Rotate
Info Catalog
(guile.info.gz) SRFI-13 Fold/Unfold/Map
(guile.info.gz) SRFI-13
(guile.info.gz) SRFI-13 Miscellaneous
39.11.13 Replicate/Rotate
-------------------------
These procedures are special substring procedures, which can also be
used for replicating strings. They are a bit tricky to use, but
consider this code fragment, which replicates the input string `"foo"'
so often that the resulting string has a length of six.
(xsubstring "foo" 0 6)
=>
"foofoo"
-- Scheme Procedure: xsubstring s from [to start end]
This is the _extended substring_ procedure that implements
replicated copying of a substring of some string.
S is a string, START and END are optional arguments that demarcate
a substring of S, defaulting to 0 and the length of S. Replicate
this substring up and down index space, in both the positive and
negative directions. `xsubstring' returns the substring of this
string beginning at index FROM, and ending at TO, which defaults
to FROM + (END - START).
-- Scheme Procedure: string-xcopy! target tstart s sfrom [sto start
end]
Exactly the same as `xsubstring', but the extracted text is
written into the string TARGET starting at index TSTART. The
operation is not defined if `(eq? TARGET S)' or these arguments
share storage - you cannot copy a string on top of itself.
Info Catalog
(guile.info.gz) SRFI-13 Fold/Unfold/Map
(guile.info.gz) SRFI-13
(guile.info.gz) SRFI-13 Miscellaneous
automatically generated byinfo2html