Libft
Custom implementation of core libc functions with additional utility helpers.
Loading...
Searching...
No Matches
Character Functions

Character classification and conversion. More...

Functions

int ft_isalnum (int c)
 Checks if a character is alphanumeric.
int ft_isalpha (int c)
 Checks if a character is alphabetic.
int ft_isascii (int c)
 Checks if a character is a valid ASCII character (0-127).
int ft_isdigit (int c)
 Checks if a character is a digit ('0'-'9').
bool ft_isincharset (char c, const char *charset)
 Checks if a character is present in a character set.
int ft_isprint (int c)
 Checks if a character is printable (32-126).
int ft_isspace (char c)
 Checks if a character is whitespace (9-13).
int ft_tolower (int c)
 Converts an uppercase letter to lowercase.
int ft_toupper (int c)
 Converts a lowercase letter to uppercase.

Detailed Description

Character classification and conversion.

Functions to test and transform individual characters.

Function Documentation

◆ ft_isalnum()

int ft_isalnum ( int c)

Checks if a character is alphanumeric.

Parameters
cCharacter to check.
Returns
Non-zero if alphanumeric, 0 otherwise.

◆ ft_isalpha()

int ft_isalpha ( int c)

Checks if a character is alphabetic.

Parameters
cCharacter to check.
Returns
Non-zero if alphabetic, 0 otherwise.

◆ ft_isascii()

int ft_isascii ( int c)

Checks if a character is a valid ASCII character (0-127).

Parameters
cCharacter to check.
Returns
Non-zero if ASCII, 0 otherwise.

◆ ft_isdigit()

int ft_isdigit ( int c)

Checks if a character is a digit ('0'-'9').

Parameters
cCharacter to check.
Returns
Non-zero if digit, 0 otherwise.
Here is the caller graph for this function:

◆ ft_isincharset()

bool ft_isincharset ( char c,
const char * charset )

Checks if a character is present in a character set.

Parameters
cCharacter to check.
charsetNull-terminated string of characters to match against.
Returns
true if found in charset, false otherwise.
Here is the caller graph for this function:

◆ ft_isprint()

int ft_isprint ( int c)

Checks if a character is printable (32-126).

Parameters
cCharacter to check.
Returns
Non-zero if printable, 0 otherwise.

◆ ft_isspace()

int ft_isspace ( char c)

Checks if a character is whitespace (9-13).

Parameters
cCharacter to check.
Returns
Non-zero if whitespace, 0 otherwise.
Here is the caller graph for this function:

◆ ft_tolower()

int ft_tolower ( int c)

Converts an uppercase letter to lowercase.

Parameters
cCharacter to convert.
Returns
Lowercase equivalent if uppercase, otherwise unchanged.

◆ ft_toupper()

int ft_toupper ( int c)

Converts a lowercase letter to uppercase.

Parameters
cCharacter to convert.
Returns
Uppercase equivalent if lowercase, otherwise unchanged.