1. Copying strings
Function Prototypes:
Char *strcpy (char *dest,char *src);
Function Description: Copies the string that the SRC points to (ending with '/') to the address space pointed to by dest, and returns a pointer to Dest.
Extension: Copies the first n bytes pointed to by SRC to the address space pointed to by dest
Function Prototypes:
Char *strncpy (char *dest,char *src,int maxlen);
2. String concatenation
Function Prototypes:
Char *strcat (char *dest,char *src);
Function Description: Add the string that the SRC points to at the end of the dest (overwrite the ' + ' at the end of the dest) and add '% ' to return a pointer to Dest.
3. Find the position of the first occurrence of character C in the string str
Function Prototypes:
Char *STRCHR (char *str,char c);
Function Description: Returns a pointer to the position of the first occurrence of C, failing to return null.
Extension: Find the position of the last occurrence of character C in the string str
Function Prototypes:
Char *STRRCHR (char *str,char c);
4. String comparisons
Function Prototypes:
int strcmp (char *str1,char *str2);
Function Description: Two strings are compared from left to right by character (by ASCII values until different characters are encountered or "/"). If STR1>STR2 returns a positive number, STR1=STR2 returns 0,STR1<STR2 returns a negative number.
Extensions: String comparisons regardless of case
Function Prototypes:
int stricmp (char *str1,char *str2);
5. String inversion
Function Prototypes:
Char *strrev (char *str);
Function Description: Reverses the order of all characters in the string str (not including ' s '). Returns a pointer to a string after the reversed order.
6. Find the first occurrence of another string in the specified string
Function Prototypes:
Char *strstr (char *str1,char *str2);
Function Description: If STR2 is a str1 string, it returns the address of the first occurrence of str2 in str1, otherwise returns null;
C-language string processing functions