39 lines
1.3 KiB
C
Executable file
39 lines
1.3 KiB
C
Executable file
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_isalpha.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: thrieg <thrieg@student.42mulhouse.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2024/09/06 12:44:45 by thrieg #+# #+# */
|
|
/* Updated: 2025/02/16 19:03:42 by thrieg ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
int ft_isalpha(int c)
|
|
{
|
|
if (c < 65 || c > 122 || (c > 90 && c < 97))
|
|
return (0);
|
|
else
|
|
return (1);
|
|
}
|
|
|
|
int ft_isspace(char c)
|
|
{
|
|
return (c == ' ' || c == '\f' || c == '\n' || c == '\r'
|
|
|| c == '\t' || c == '\v');
|
|
}
|
|
|
|
int ft_tolower(int c)
|
|
{
|
|
if (c >= 'A' && c <= 'Z')
|
|
return (c + ('a' - 'A'));
|
|
return (c);
|
|
}
|
|
|
|
int ft_toupper(int c)
|
|
{
|
|
if (c >= 'a' && c <= 'z')
|
|
return (c - ('a' - 'A'));
|
|
return (c);
|
|
}
|