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).
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.
Return the string s1, but with the characters start1 … end1 replaced by the characters start2 … end2 from s2.
Split the string s into a list of substrings, where each
substring is a maximal non-empty contiguous sequence of
characters from the character set token_set, which
defaults to char-set:graphic
.
If start or end indices are provided, they restrict
string-tokenize
to operating on the indicated substring
of s.
Filter the string s, retaining only those characters which satisfy char_pred.
If char_pred is a procedure, it is applied to each character as a predicate, if it is a character, it is tested for equality and if it is a character set, it is tested for membership.
Delete characters satisfying char_pred from s.
If char_pred is a procedure, it is applied to each character as a predicate, if it is a character, it is tested for equality and if it is a character set, it is tested for membership.
The following additional functions are available in the module
(ice-9 string-fun)
. They can be used with:
(use-modules (ice-9 string-fun))
Return a new string where every instance of substring in string str has been replaced by replacement. For example:
(string-replace-substring "a ring of strings" "ring" "rut") ⇒ "a rut of struts"