C String Functions

You are Here:

C String Functions

The following are the list of inbuilt string functions in c programming.

FunctionsExplanation
strcat()Appends the source string to the destination string.
strncat()Appends the source string to the destination string up to the specified length.
strcpy()Copies a string from source to destination.
strncpy()Copies a string from source to destination up to the specified length.
strlen()Determines the length of the given string.
strcmp()Compares the characters of two strings (This function discriminates between lower case and upper case).
strncmp()Compares the characters of two strings up to the specified length (This function discriminates between lower case and upper case).
stricmp()Compares the characters of two strings (This function doesn't discriminates between lower case and upper case).
strchr()Determines the first occurrence of the given character in the string.
strrchr()Determines the last occurrence of the given character in the string.
strstr()Determines the first occurrence of a given string in another string.
strdup()Duplicates a given string at the allocated memory which is pointed by a pointer variable.
strlwr()Converts any string to a lower case.
strupr()Converts any string to a upper case.
strrev()Reverses all characters of a given string.
strset()Replaces every character of a string with the symbol given by the programmer.
strnset()Replaces every character of a string with the symbol given by the programmer up to the specified length.
strtok()Breaks string into a series of tokens using the given delimiter.
strerror()Translates the error code to a suitable string that describes the error.
strpbrk()Searches the first occurrence of the character in a given string and then it displays the string starting from that character.
strcoll()Compares two strings depends upon the LC_COLLATE settings.
strspn()Finds up to what length two strings are identical.
strcspn()Scans string 1 for the first occurrence of any of the characters that are part of string 2.
strxfrm()Transforms the first n characters of source string into current locale and place them in destination string.
memchr()Searches for the first occurrence of the character in a specified number of characters.
memmove()Copies a block of memory from a location to another using an intermediate buffer.
memcpy()Copies a block of memory from a location to another without using an intermediate buffer.
memcmp()Compares the first n bytes of memory area str1 and memory area str2.
memset()Replaces every character of a string with the symbol given by the programmer up to the specified length.

Reminder

Hi Developers, we almost covered 98% of String functions and Interview Question on C with examples for quick and easy learning.

We are working to cover every Single Concept in C.

Please do google search for:

Join Our Channel

Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.

This channel is primarily useful for Full Stack Web Developer.

Share this Page

Meet the Author