split3()

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

str

const char *

The input string to be split.

delim

const char *

A string containing delimiter characters used to split str.

plist_size

int *

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