String Library functions
char *strcat(s,cs) Concatenates a copy of cs to end of s; returns s. char *strncar(s,cs,n) Concatenates a copy of at most n characters of cs to end of s; returns s; char *strcpy(s,cs) Copies cs to s including \0. returns s. char *strncpy(s,cs,n) Copies at most n characters of cs to s; returns s; pads with \0 if cs has less than n characters char *strtok(s,cs) Finds tokens in s delimited by characters in cs. size_t strlen(cs) Returns length of cs (excluding \0) int strcmp(cs1,cs2) Compares cs1 and cs2; returns negative, zero, or positive value for cs1 <,==, or > cs2 respectively int strncmp(cs1,cs2,n) Compares first n characters of cs1 and cs2; returns as in strcmp. char *strchr(cs,c) Returns pointer to first occurrence of c in cs char *strrchr(cs,c) Returns pointer to last occurrence of c in cs char *strpbrk(cs1,cs2) Returns pointer to first char in cs1 and cs2 char *strstr(cs1,cs2) Returnss pointer to first occurrence of cs2 in cs1 ==> The 4 above functions return NULL if search fails size_t strspn(cs1,cs2) Returns length of prefix of cs1 consisting of characters from cs2 size_t strcspn(cs1,cs2) Returns length of prefix of cs1 consisting of characters not in cs2
Note: This table is from page 140 in [IACU]More exciting string functions in /usr/include/string.h ...