Tuesday, November 8, 2011

String Manipulation Functions in C programming

String Manipulation Functions


Function
Use
      strchr
Appends one string to another
strchr
Finds first occurrence of a given character in a string
strcmp
Compares two strings
strcmpi
Compares two strings without regard to case
strcpy
Copies one string to another
strdup
Duplicates a string
stricmp
Compares two strings without regard to case (identical to strcmpi)
strlen
Finds length of a string
strlwr
Converts a string to lowercase
strncat
Appends a portion of one string to another
strncmp
Compares a portion of one string with portion of another string
strncpy
Copies a given number of characters of one string to another
strnicmp
Compares a portion of one string with a portion of another without regard to case
strrchr
Finds last occurrence of a given character in a string
strrev
Reverses a string
strset
Sets all characters in a string to a given character
strstr
Finds first occurrence of a given string in another string
strupr
Converts a string to uppercase

No comments:

Post a Comment