Next: Queues, Previous: Lists, Up: API Reference [Contents][Index]
Grip procedures and variables to process strings. The module is loaded by entering the following:
(use-modules (grip string))
string-replace-all
string-delete-all
string-escape
string-escape-sql
string-escape-filename
string-tokens
string-contains-ixs
string-contains-ci-ixs
string-span
string-read
%filename-reserved-chars
Returns a string.
Replace all occurrences of s1 in the start end range of str by s2. It is an error to pass an empty s1 value.
Returns a string.
Delete all occurrences of s1 in the start end range of str. It is an error to pass an empty s1 value.
Returns a string.
Replaces all str occurrences of c1, c2, c3 … by \c1, \c2, \c3 …
Returns a string.
Replaces all str occurrences of '
by ''
.
Returns a string.
This procedure is implemented as (apply string-escape str chars)
,
where chars, which is optional, defaults to the list given by
%filename-reserved-chars.
If you provide your own list of chars and if it contains \
, then
it must be the first element of the list (since \
is the escape
char itself).
Returns a a list of strings.
Split the string into a list of substring, where each substrig is a maximal non-empty contiguous sequence of characters, defined as:
(char-set-complement (apply char-set chars))
If start or end are provided, they restrict
string-tokens
to operate on the indicated substring of str.
Returns three values.
If s1 contains s2, the returned values are the s1
index of the first char of s2, the s1 index of the first
char that follows s2, and the length of s2. Otherwise, it
returns #f #f
and the length of s2.
The optional keyword start/end indices maybe be provided to restrict the operation to the indicated substring.
Returns three values.
If s1 contains s2, the returned values are the s1
index of the first char of s2, the s1 index of the first
char that follows s2, and the length of s2. Otherwise, it
returns #f #f
and the length of s2.
The optional keyword start/end indices maybe be provided to restrict the operation to the indicated substring.
Character comparison is done case-insensitively.
Returns a string.
Makes a ‘span’ string as defined by the
Pango Text Attribute Markup
Language. Note that string-span
does not verify the validity of
provided properties and values. For example:
(string-span "Guile" "foreground" "blue" "size" "x-large") -| $2 = "<span foreground=\"blue\" size=\"x-large\">Guile</span>"
It is an error to pass an odd quantity of properties and values.
Returns a value.
The returned value is the result of calling read
upon str,
as in:
(with-input-from-string str read)
A list containing the following characters:
\ space < > | ( ) & ; # ? *
Next: Queues, Previous: Lists, Up: API Reference [Contents][Index]