-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_str_replace.c
27 lines (24 loc) · 1.04 KB
/
ft_str_replace.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_str_replace.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: abenamar <abenamar@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/09/09 22:13:37 by abenamar #+# #+# */
/* Updated: 2023/09/09 22:14:35 by abenamar ### ########.fr */
/* */
/* ************************************************************************** */
#include "minishell.h"
char *ft_str_replace(char *str, char c1, char c2)
{
size_t i;
i = 0;
while (str[i])
{
if (str[i] == c1)
str[i] = c2;
++i;
}
return (str);
}