String library function: – String library function are available inside string.h. The purpose of string library functions are to support all the necessary operation to process the string. The few example of string library function are as bellow –

  1. strlen();
  2. strcmp();
  3. strcpy();
  4. strcat();
  5. strrev();
  6. strupr();
  7. strlwr();

String length (strlen()): – This function is used to calculate the length of string width excluding NULL character (\0) in the terms of integer. Inside the parenthesis of this function we provide the string.

String compare (strcmp()): – This function is use to compare two strings. After making compression this function returns zero (0) if both string are same. If both string are not same them it will return -1 or 1. Inside the parenthesis of this function we will pass two string as actual argument.

String copy (strcpy()): – This function is we to copy the value of one string into another string. Inside the parenthesis of this function, there are two argument is destination and second argument is source.

String concatenation (strcat()): – This function is use to upend or add the value of one string into another string (From last position). Inside the parenthesis of this function there are also two argument.

String reverse (strrev()): – Ths function is use to reverse the string. Inside the parenthesis of this function there is only one argument.

String uppercase (strupr()): – This function is use to convert lowercase to uppercase character. Inside the parenthesis of this function there is only one argument.

String lowercase (strlwr()): – This function is use to convert uppercase to lowercase character. Inside the parenthesis of this function. There is only one argument.

Advertisements