strspn - Get initial length of s1 excluding the characters of s2
| 181 | |
| 182 | // strspn - Get initial length of s1 excluding the characters of s2 |
| 183 | size_t strcspn(const char *s1, const char *s2) |
| 184 | { |
| 185 | size_t ret = 0; |
| 186 | while (*s1) |
| 187 | if (strchr(s2, *s1)) |
| 188 | return ret; |
| 189 | else |
| 190 | s1++, ret++; |
| 191 | return ret; |
| 192 | } |
| 193 | |
| 194 | // strtok - breaks str into tokens using specified delimiters |
| 195 | char *strtok(char * str, const char * delim) |