-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_strclean.c
26 lines (23 loc) · 1.12 KB
/
ft_strclean.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strclean.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: edelangh <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2015/02/08 16:08:40 by edelangh #+# #+# */
/* Updated: 2015/02/08 16:08:52 by edelangh ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strclean(char *str, char *epur)
{
int i;
i = -1;
if (!str || !epur)
return (str);
while (str[++i])
while (str[i] && ft_strchr(epur, str[i]))
ft_memmove(str + i, str + 1 + i, ft_strlen(str + i));
return (str);
}