String Functions: Strcpy Function

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 3

String Functions

strcpy( ) Function:
This function is used to copy one string in another string. Its syntax is strcpy(string1, string2);

strlen( ) Function:
This function is used to return the length of a string (All characters before null termination).
Its syntax is strlen(string1);

strcmp( ) Function:
This function is used to compare one string with another and returns a signed number whether str1 is greater than,
less than or equal to str2. Its syntax is strcmp(string1, string2);

strcat( ) Function:
This function is used to concatenates string 2 to the end of string 1. Its syntax is strcat(string1, string2);

Page 1|3

strncpy( ) Function:
This function is used to copy a specified number of characters to string1 to string2. Its syntax is strncpy(string1,
string2, n);

strlwr( ) Function:
This function is used to convert upper case letter to lower case. Its syntax is strlwr(String1);

strupr( ) Function:
This function is used to convert lower case letter to upper case. Its syntax is strupr(String1);

Page 2|3

strchr( ) Function:

Page 3|3

You might also like