String Handling Functions


Strings are an important aspects of programming. We can use string to write message to the user and read text directly to make interactions with users go smoothly.

While programming it is necessary to handle different operations on string like string copy, string concatenation, string reverse, converting to lower case and upper case etc.

The standard library of C contains many useful string-handling functions. The function prototypes for these string handling functions are defined in standard header file string.h. In this tutorial, we look at some of these string handling functions.

String Handling Functions in C

Some useful string handling functions in C programming language are:

  1. strlen(): Finding length of the string.
  2. strcpy(): Copying string.
  3. strcmp(): Comparison of two strings.
  4. strcat(): Concatenation of two strings.
  5. strrev(): Reversing the string.
  6. strlwr(): Converting string to lower case.
  7. strupr(): Converting string to upper case.