ss_string_crop_c_string(3) - Linux man page

Name

ss_string_crop family - deletes a substring of a string

Synopsis

#include <sstrings2.h>

Linking with -lsstrings2

int ss_string_crop(ss_string *string, const ss_string *pattern);
int ss_string_crop_c_string(ss_string *string, const char *pattern);
int ss_string_crop_c_string_l(ss_string *string, const char *pattern, size_t patt_len);

int ss_string_rcrop(ss_string *string, const ss_string *pattern);
int ss_string_rcrop_c_string(ss_string *string, const char *pattern);
int ss_string_rcrop_c_string_l(ss_string *string, const char *pattern, size_t patt_len);

Description

ss_string_crop deletes the first occurence of the substring pattern in string. Note that both parameter must be valid ss_string objects (initialized with ss_string_new).

ss_string_crop_c_string deletes the first occurence of the substring (a C-string pointed to by pattern) in string. Note that string must be a valid ss_string object.

ss_string_crop_c_string_l works like ss_string_crop_c_string. The third parameter, patt_len, is the right length of pattern. Note that this function does not check whether patt_len is the right length of pattern.

The ss_string_rcrop_* functions work the same way but they delete the last occurence of pattern in string.

Returning values

The functions return 1 on succes, -1 if pattern is not found. They return 0 on error.

Error values for ss_errno

SS_NULL if one parameter

is NULL

SS_EINVAL if the ss_string objects are invalid

Bugs

Please send

your bug reports to yanezp@informatik.uni-freiburg.de

See Also

ss_string_new(3), ss_string_crop(3), ss_string_rcrop(3), ss_string_replace(3), ss_string_insert(3)

Referenced By

sstrings2(5)