-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_substr.c
21 lines (19 loc) · 1.05 KB
/
ft_substr.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_substr.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: tpouget <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/05/14 17:04:38 by tpouget #+# #+# */
/* Updated: 2021/04/19 15:32:39 by tpouget ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char *ft_substr(char const *s, unsigned int start, size_t len)
{
if (ft_strlen(s) > start)
return (ft_strndup(s + start, len));
else
return (ft_strdup(""));
}