Explain the various character functions with example.


1. tolower()- this function convert a character to lower case. 
Example : tolower(‘A’)=a

2. toupper()- this function converts a character to upper case. 

Example : toupper(‘b’)=B

3. toascii()- this function converts character to its ascii equivalent. The output is an integer. 
Example : toascii(‘a’)=65

4. isalpha()- this function checks if a given character is an alphabet or not. 
Example : isalpha(‘a’)=true isalpha(‘*’)=false

5. isdigit()- checks if a given character is a digit or not. 
Example : isdigit(‘8’)= true isdigit(‘I’)=false

6. isspace()- checks if a given character is a white space or not. 
Example : isspace(‘ ‘)=true isspace(‘%’)=false

7. ispunct()- checks if a given character is a punctuation or not. 
Example : ispunct(‘?’)=true ispunct(‘ “)=false

8. islower()-checks if a given character is in lower case or not. 
Example : islower(‘a’)=true islower(‘L’)=false

9. isupper()-checks if a given character is in uppercase or not. 

Example : isupper(‘M’)=true isupper(‘h’)=false



Thanks
Mukesh Rajput
Mukesh Rajput

Mukesh Rajput

I am a Computer Engineer, a small amount of the programming tips as it’s my hobby, I love to travel and meet people so little about travel, a fashion lover and love to eat food, I am investing a good time to keep the body fit so little about fitness also..

Post A Comment:

0 comments: