split3()
#
Splits the input string str
into a list of substrings using the specified delimiters delim
. Unlike split2()
, this function includes empty substrings in the result.
Prototype
const char **split3(
const char *str,
const char *delim,
int *plist_size
);
Parameters
Key |
Type |
Description |
---|---|---|
|
|
The input string to be split. |
|
|
A string containing delimiter characters used to split |
|
|
Pointer to an integer that will be set to the number of substrings found. |
Return Value
A dynamically allocated array of strings containing the split substrings. The caller must free the returned array using split_free3()
. Returns NULL
on failure.
Notes
This function differs from split2()
in that it includes empty substrings in the result when consecutive delimiters are found.
Prototype
// Not applicable in JS
Prototype
# Not applicable in Python
Examples
// TODO C examples
// TODO JS examples
# TODO Python examples