String Handling Functions

C Provides a number of useful function of these type of handling string. These function are in the common string library function which are supported by most C compilers. You can directly use these function in your programs.
Some of the most common string library function supported by most C compilers includes:

Function Use
strcat() Append one string at the end of other
strncat() Append first n character of a string at the end of another
strcpy() copies one string into another
strncpy() copies the first n characters of one string into another
strcmp() compare two strings
strncmp() compares the first n characters of two strings
strcmpi()/
stricmp() compare two strings ignoring the case
strnicmp() compares the first n characters of two strings without regard to case
strdup() duplicates a string
strchr() finds the first occurrence of a given character in a string
strrchr() find last occurrence of a given string in another string
strlen() Finds the length of a string
strlwr() convert a string into lowercase
strupr() convert a string into uppercase
strset() sets all the characters of a string to a given character
strnset() sets the first n characters of a string to a given character
strrev() reverse a string

No comments:

Post a Comment