#include<ctype.h>
Function | Description |
isalpha() | check character is an alphabet |
isdigit() | check character is a digit |
isalnum() | check character is an alphabet or a number |
islower() | Check the character has lower case |
isupper() | Check the character has an upper case |
isspace() | check character is a space |
ispunct() | check character is punctuation |
tolower() | convert into a lowercase character |
toupper() | convert into an upper-case character |
String in C programming
String
The collection of characters is called a string.
Declaration & initialisation of a string
char name[100]="capscom";
strlen
Return length of a string
strlen(string)
strcpy
Copy one string into other string
strcpy(str1, str2)
strcat
Concat one string with other string
strcat(str1, str2)
strcmp
Compare two string and return
- -1 if string1 is smaller than string2
- 0 if string1 is same as string2
- 1 if string1 is greater than string2
strcmp(str1, str2)