strlen() function in C is used to calculate the length of the given string. It counts the number of characters present in a String excluding the null character ‘\0‘.
The strlen() function is defined in the header file
string.h. It takes one argument that is the string name and written as follows:
C Program for strlen() function
char str = "Simple2Code";
printf("Length of a String str: %zu", strlen(str));
Length of a String str: 11