Some common functions about strings in C language, C language strings
Add string. h to the header file when using the following:
Getch () is the asc code that is returned when you type any value but is not displayed. The compilation is completed immediately.
Getchar (); after you press enter, the input is complete. You can use putchar () to display the first character. The return value is the asc code.
Puts () Outputs a string (only one) to the terminal, which can contain escape characters.
Gets (); enter a string from the terminal to the character array and obtain a function value. The function value is the starting address of the character array.
Strcat (str1, str2); string catenate string connection function, concatenates string 2 to string 1
Strcpy (character array 1, string 2 (can be an array or a String constant); // you cannot assign a string to an array directly or assign an array to another array, values can only be assigned using the strcpy () function.
Strncpy (character array, string 2, n); string copy indicates replacing the first n digits of the character array with the first n digits of the character array.
Strcmp (string 1, string 2); string compare compares whether two strings are the same. If they are equal, the return value is 0. If they are not equal, the result of comparing different first digits is used as a reference. If String 1> string 2 is used, the return value is positive. Otherwise, the return value is negative.
Strlen (); returns the string length function string length
Strlwr (); English string lowercase; function for converting uppercase letters into lowercase letters
Strupr (); string uppercase; converts lowercase letters of a string to uppercase.