diff --git a/libft/ft_str_is_only_char.c b/libft/ft_str_is_only_char.c new file mode 100644 index 0000000..3bc8081 --- /dev/null +++ b/libft/ft_str_is_only_char.c @@ -0,0 +1,20 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_str_is_only_char.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: marde-vr +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2024/04/29 11:11:31 by marde-vr #+# #+# */ +/* Updated: 2024/04/29 11:11:57 by marde-vr ### ########.fr */ +/* */ +/* ************************************************************************** */ + +int ft_str_is_only_char(char *str, char c) +{ + while (c && *str == c) + str++; + if (!*str && c) + return (1); + return (0); +}