28 lines
1.1 KiB
C
28 lines
1.1 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* ft_strrchr.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: grobledo <marvin@42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2023/02/04 14:00:32 by grobledo #+# #+# */
|
|
/* Updated: 2023/02/13 21:32:54 by grobledo ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
#include "libft.h"
|
|
|
|
char *ft_strrchr(const char *str, int tofind)
|
|
{
|
|
int i;
|
|
|
|
i = 0;
|
|
while (str[i])
|
|
i++;
|
|
while (i >= 0)
|
|
{
|
|
if ((unsigned char)str[i] == (unsigned char)tofind)
|
|
return ((char *)&str[i]);
|
|
i--;
|
|
}
|
|
return (0);
|
|
}
|