libft
|
Go to the source code of this file.
Functions | |
char ** | ft_strsplit (char const *s, char delim) |
Splits a string on whitespace characters. More... | |
char** ft_strsplit | ( | char const * | s, |
char | delim | ||
) |
Splits a string on whitespace characters.
Allocates (with malloc
) and returns an array of “fresh” strings (all ending with '\0'
, including the array itself) obtained by splitting s
using the character c
as a delimiter.
ft_strsplit("*hello*fellow***students*", ’*’)
returns the array ["hello", "fellow", "students"]
. s | The string to split. |
delim | The delimiter character. |
NULL
if any of the allocations failed. Definition at line 70 of file ft_strsplit.c.