Next: , Previous: , Up: strings   [Index]


25.10 Selection

Macro: substring* S

Wrapper for substring accepting a string view as argument.

Function: %string-copy* str start past
Macro: string-copy* S

The function %string-copy* is an alias for substring; the macro string-copy* is an alias for substring*.

These exist for symmetry with the (vicare containers vectors) library; they allow more confidence in converting a vector function into a string function, and vice versa, by just replacing the string vector with the string string, and vice versa.

Function: %string-reverse-copy* str start past
Macro: string-reverse-copy* S

Like %string-copy*, but copy the elements in the reverse order from the selected substring of str.

(string-reverse-copy* (view "543210")
                        (start 1)
                        (past  5)))
⇒ "1234"
Function: %string-copy*! dst-str dst-start src-str src-start src-past
Macro: string-copy*! dst-S src-S

Write the selected source substring into the selected destination substring. This function is the side–effecting variant of substring and substring*. This function supports copying over the same string.

The selected destination substring starts at dst-start in dst-str and may extend until the end of the string. In the destination string view dst-S: If a past index is specified, it is ignored.

Function: %string-reverse-copy*! dst-str dst-start src-str src-start src-past
Macro: string-reverse-copy*! S-dst S-src

Like %string-copy*!, but this copies the elements in the reverse order. This function supports copying over the same string.

Function: %string-take nchars str start past
Function: %string-take-right nchars str start past
Macro: string-take S nchars
Macro: string-take-right S nchars

Return the first or last nchars of the selected substring. These functions always return a newly allocated string.

Function: %string-drop nchars str start past
Function: %string-drop-right nchars str start past
Macro: string-drop S nchars
Macro: string-drop-right S nchars

Drop the first or last nchars of the selected substring and return the resulting string. These functions always return a newly allocated string.


Next: , Previous: , Up: strings   [Index]