docs/Writerside/topics/string.h.md

changeset 1668
3ffdfe1776b4
parent 1667
608cc0b25352
child 1671
cf19b7820ff0
equal deleted inserted replaced
1667:608cc0b25352 1668:3ffdfe1776b4
148 ## Find Characters and Substrings 148 ## Find Characters and Substrings
149 149
150 ```C 150 ```C
151 #include <cx/string.h> 151 #include <cx/string.h>
152 152
153 char cx_strat(cxstring str, off_t index);
154
153 cxstring cx_strchr(cxstring string, int chr); 155 cxstring cx_strchr(cxstring string, int chr);
154 156
155 cxstring cx_strrchr(cxstring string, int chr); 157 cxstring cx_strrchr(cxstring string, int chr);
156 158
157 cxstring cx_strstr(cxstring string, AnyStr search); 159 cxstring cx_strstr(cxstring string, AnyStr search);
172 174
173 cxmutstr cx_strsubsl_m(cxmutstr string, size_t start, size_t length); 175 cxmutstr cx_strsubsl_m(cxmutstr string, size_t start, size_t length);
174 176
175 cxmutstr cx_strtrim_m(cxmutstr string); 177 cxmutstr cx_strtrim_m(cxmutstr string);
176 ``` 178 ```
179
180 The function `cx_strat()` returns the character at the specified `index`.
181 When the `index` is negative, the characters are counted from the end of the string.
182 When the `index` is out of bounds, the zero-character is returned.
177 183
178 The functions `cx_strchr()`, `cx_strrchr()`, and `cx_strstr()`, behave like their stdlib counterparts. 184 The functions `cx_strchr()`, `cx_strrchr()`, and `cx_strstr()`, behave like their stdlib counterparts.
179 185
180 The function `cx_strsubs()` returns the substring starting at the specified `start` index, 186 The function `cx_strsubs()` returns the substring starting at the specified `start` index,
181 and `cx_strsubsl()` returns a substring with at most `length` bytes. 187 and `cx_strsubsl()` returns a substring with at most `length` bytes.

mercurial