alnum, alpha, ascii, digit, print, strlen
This commit is contained in:
commit
8bbb452128
|
@ -0,0 +1,17 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_isalnum.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: tischmid <timo42@proton.me> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/05/03 22:06:00 by tischmid #+# #+# */
|
||||
/* Updated: 2023/05/03 22:38:49 by tischmid ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
int ft_isalnum(int c)
|
||||
{
|
||||
return (8 * (((c | 32) >= 'a' && (c | 32) <= 'z')
|
||||
|| (c >= '0' && c <= '9')));
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_isalpha.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: tischmid <timo42@proton.me> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/05/03 14:37:56 by tischmid #+# #+# */
|
||||
/* Updated: 2023/05/03 21:42:51 by tischmid ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
int ft_isalpha(int c)
|
||||
{
|
||||
return (1024 * ((c | 32) >= 97 && (c | 32) <= 122));
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_isascii.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: tischmid <timo42@proton.me> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/05/03 22:37:57 by tischmid #+# #+# */
|
||||
/* Updated: 2023/05/03 22:40:05 by tischmid ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
int ft_isascii(int c)
|
||||
{
|
||||
return (c >= 0 && c <= 127);
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_isdigit.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: tischmid <timo42@proton.me> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/05/03 17:12:29 by tischmid #+# #+# */
|
||||
/* Updated: 2023/05/03 19:38:50 by tischmid ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
int ft_isdigit(int c)
|
||||
{
|
||||
return (2048 * (c >= '0' && c <= '9'));
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_isprint.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: tischmid <timo42@proton.me> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/05/03 22:42:16 by tischmid #+# #+# */
|
||||
/* Updated: 2023/05/03 23:03:52 by tischmid ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
int ft_isprint(int c)
|
||||
{
|
||||
return (16384 * ((c >= 32) && (c <= 126)));
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* ::: :::::::: */
|
||||
/* ft_strlen.c :+: :+: :+: */
|
||||
/* +:+ +:+ +:+ */
|
||||
/* By: tischmid <timo42@proton.me> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/05/03 23:07:08 by tischmid #+# #+# */
|
||||
/* Updated: 2023/05/03 23:16:02 by tischmid ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
size_t ft_strlen(const char *s)
|
||||
{
|
||||
size_t length;
|
||||
|
||||
length = 0;
|
||||
while (*s++)
|
||||
length++;
|
||||
return (length);
|
||||
}
|
Loading…
Reference in New Issue