[ Previous | Next | Table of Contents | Index | Library Home |
Legal |
Search ]
General Programming Concepts: Writing and Debugging Programs
The character manipulation
functions and macros test and translate ASCII characters.
These functions and macros are of
three kinds:
- Character testing
- Character translation
- Miscellaneous character
manipulation
The Programming Example for Manipulating Characters illustrates some of the character manipulation
routines.
Use the following functions and
macros to determine character type. Punctuation, alphabetic, and
case-querying functions values depend on the current collation table.
The ctype subroutines contain the following
functions:
| isalpha
| Is character alphabetic?
|
| isalnum
| Is character alphanumeric?
|
| isupper
| Is character uppercase?
|
| islower
| Is character lowercase?
|
| isdigit
| Is character a digit?
|
| isxdigit
| Is character a hex digit?
|
| isspace
| Is character a blank-space character?
|
| ispunct
| Is character a punctuation character?
|
| isprint
| Is character a printing character, including space?
|
| isgraph
| Is character a printing character, excluding space?
|
| iscntrl
| Is character a control character?
|
| isascii
| Is character an integer ASCII character?
|
The conv subroutines contain the following
functions:
| toupper
| Converts a lowercase letter to uppercase
|
| _toupper
| (Macro) Converts a lowercase letter to uppercase
|
| tolower
| Converts an uppercase letter to lowercase
|
| _tolower
| (Macro) Converts an uppercase letter to lowercase
|
| toascii
| Converts an integer to an ASCII character
|
Chapter 16, National Language Support
Programming Example for Manipulating Characters
Chapter 24, Subroutines, Example Programs, and Libraries
[ Previous | Next | Table of Contents | Index |
Library Home |
Legal |
Search ]