Sunday, 21 January 2018

String Handling Functions In C


String Handling Functions In C

String Handling Functions In C
With every C compiler a large set of useful string handling library functions are provided. The following figure illustrates the more commonly used functions along with their
purpose.

1.strlen: Finds length of a string
2.strlwr: Converts a string to lower case
3.strupr: Converts a string to upper case
4.strcat: Appends one string at the end of the other
5.strncat: Appends first n characters of a string at
  the end of another
6.strcpy: Copies a string into another
7.strncpy: Copies first n characters of one string into
 another
8.strcmp: Compares two strings
9.strncmp: compares first n characters of two strings
10.strcmpi: compares two strings without regard to case
11.strnicmp: compares first n characters of two strings
   without regard to case
12.strdup: duplicates a string
13.strchr: finds first occurrence of a given character in a
  string
14.strrchr: Finds last occurrence of a given character in a
   string
15.strstr: Finds first occurrence of a given string in another
   string
16.strset: Sets all characters of string to a given character
17.strnset: Sets first n characters of a string to a given
 character
18.strrev: Reverses string
strlen()
strcpy()
strcat()
strcmp()

Related Posts:

  • Pointers And Structures Pointers And Structures  We know that the name of an array stands for the address of its zeroth element.The same thing is true of the names of  arrays of structure variables.Suppose product is an array variabl… Read More
  • Initialization of Arrays Initialization of Arrays We can initialize the elements of the array in the same way as the ordinary variables when they are declared.The general form of initialization of array is:  static  type  array-… Read More
  • Declaration of Arrays Declaration of Arrays  Like any other variables, arrays must be declared before they are used.The general form of array declaration is type variable-name [size]; The type specifies the type of elements that will be… Read More
  • Two-Dimentional Arrays Two-Dimentional Arrays So far we have discussed the array variable that can store a list of values .There will be situation where a table of values will have to be stored.Consider the following data table, which shows t… Read More
  • Introduction To Storage Classes Introduction To Storage Classes strong class provides information about their location and visibility.The storage class decides the portion of the program within which the variables are recognized. A variables storage cl… Read More

0 comments:

Post a Comment