-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_chareplace.c
27 lines (24 loc) · 1.03 KB
/
ft_chareplace.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
27
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strepace.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: magoumi <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2018/10/25 10:26:43 by magoumi #+# #+# */
/* Updated: 2018/10/25 11:02:36 by magoumi ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_chareplace(char *s, char rep, char with)
{
int i;
i = 0;
while (s[i])
{
if (s[i] == rep)
s[i] = with;
i++;
}
return (s);
}