Substring modification¶
ss_string_splice
is a function defined in ssstring.c.
Synopsis:
-
herr_t
ss_string_splice
(ss_string_t *str, const char *value, size_t start, size_t nbytes, size_t nreplace)¶
Formal Arguments:
str
: String object to be modified by this operation.value
: Optional new data for part of the string value. If this argument is the null pointer andnbytes
is positive then the new data will be allNUL
characters (this allows for an easy way to extend the length of a string).start
: Byte offset at which to place the new data in the string.nbytes
: Length of the new data in bytes.nreplace
: Number of bytes replaced by the new data. IfSS_NOSIZE
is passed then all bytes fromstart
to the end of the original value will be replaced by the new value.
Description: This function is able to modify a string value by modifying, inserting, or deleting bytes. It does not assume
that value
is a C-style NUL
-terminated string.
Return Value: Returns non-negative on success; negative on failure.
Parallel Notes: Independent
See Also:
- Strings: Introduction for current chapter