18 most common string function in C language

Let’s see some of the top uses string function in C language. You can see the relevant programs by clicking the link given with each string function.

gets() – We use gets() string function in C to take string input from user. See details and example program using gets() from here.

puts() – This string function is used to print the output of a string. See details and example program using puts() from here.

strlen() – strlen() string function in C is used to find out the length of a string. See details and example program using strlen() from here.

strlwr() : This string function is used to convert a string to lowercase. See details and example program using strlwr() from here.

strupr() : This string function is used to convert a string to uppercase. See details and example program using strupr() from here.

strcat() : This string function is used to append a string at the end of another. See details and example program using strcat() from here.

strncat() : This string function is used to append first n characters of a string at the end of another. See details and example program using strncat() from here.

strcpy() : strcpy() string function in C is used to copy a string to another string. See details and example program using strcpy() from here.

strncpy() : This string function is used to copy first n characters of a string to another. See details and example program using strncpy() from here.

strcmp() : This string function is used to compare two string. See details and example program using strcmp() from here.

strncmp() : This string function is used to compare first n characters of two string. See details and example program using strncmp() from here.

strdup() : This string function is used for duplicating a string. See details and example program using strdup() from here.

strchr() : This string function is used to find out first occurrence of a given character of string. See details and example program using strchr() from here.

strrchr() : This string function is used to find out last occurrence of a given character in a string. See details and example program using strrchr() from here.

strstr() : This string function is used for finding first occurrence of a given string in another string. See details and example program using strstr() from here.

strset() : This string function is used to set all characters of string to a given character. See details and example program using strset() from here.

strnset() : This string function is used to set first n characters of a string to a given character. See details and example program using strnset() from here.

strrev() : strrev() string function in C is used to reverse a string. See details and example program using strrev() from here.

Previous pageString in C

Next pagegets() & puts() function