Files
42_INT_01_libft/srcs/ft_strchrset.c

33 lines
1.2 KiB
C

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strchrset.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: hulamy <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/02/16 15:07:11 by hulamy #+# #+# */
/* Updated: 2020/02/16 15:12:03 by hulamy ### ########.fr */
/* */
/* ************************************************************************** */
/*
** return 1 if any character of the character set is found in s
** else return 0
*/
#include "libft.h"
char *ft_strchrset(const char *s, const char *set)
{
int i;
i = 0;
while (set[i] != '\0')
{
if (ft_strchr(s, set[i]) != NULL)
return ((char *)set + i);
i++;
}
return (0);
}