String Functions in C Programming Language

| Last Updated: | In: C Programming Tutorial

In this tutorial, we will share the string functions in c programming language. In c programming, strings are always enclosed by the double quotes and character is enclosed by the single quotes.

Below is teh example of String and character:

Below is an example of String in c programming lanaguage:

Below are the lists of all string function with its descriptions used in c programming language:

functions Description
strcat ( ) Concatenates string at the end of string1
strncat ( ) Appends a portion of string to another string
strcpy ( ) Copies string1 into string2
strncpy ( ) Copies given number of characters of one string to another
strlen ( ) Print the length of string
strcmp ( ) It Returns a negative, zero, or positive integer depending on whether the object pointed to by s1 is less than, equal to, or greater than the object pointed to by s2.
strcmpi() Same as strcmp() function.
strchr ( ) Returns pointer to first occurrence of char in string
strrchr ( ) last occurrence of given character in a string is found
strstr ( ) Returns pointer to first occurrence of string2 in string1
strrstr ( ) Returns pointer to last occurrence of string2 in string1
strdup ( ) Duplicates the string
strlwr ( ) Converts string to lowercase
strupr ( ) Converts string to uppercase
strrev ( ) Reverses the string
strset ( ) Sets all character in a string
strnset ( ) Sets the portion of characters in a string
strtok ( ) Tokenizing given string using delimiter

About: Prem Tiwari

Prem Tiwari is the founder of and is a professional developer who has vast experience in PHP and open source technologies. Apart from this, he is a blogger by hobby.

You may also like:

Tags: , , , ,