toSegments

Extracts segments from a slash-separated URL path and stores them in a given store array which has been pre-allocated.

@safe @nogc
int
toSegments
(
string path
,
scope string[] store
)

Parameters

path string

The path to parse.

store string[]

The array to store segments in. Consider allocating this on the stack for performance improvements.

Return Value

Type: int

The number of segments that were parsed, or -1 if the given store is too small to fit all of them.

Meta