-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_strndelat.c
23 lines (20 loc) · 1.11 KB
/
ft_strndelat.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_strndelat.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tmoska <tmoska@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/02/27 16:01:27 by tmoska #+# #+# */
/* Updated: 2017/02/27 17:52:24 by tmoska ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_strndelat(char *str, int index, size_t size)
{
char *ret;
ret = ft_strnew(ft_strlen(str) - size);
ret = ft_strncpy(ret, str, index);
ret[index] = *ft_strcpy(&ret[index], &str[index + (int)size]);
return (ret);
}