split

Splits a string in two around one or more compile-time known code units.

  1. bool split(inout(char[]) str, inout(char)[] before, inout(char)[] after, char* splitter)
    bool
    split
    (
    string match
    )
    (
    scope inout(char[]) str
    ,
    ref inout(char)[] before
    ,
    ref inout(char)[] after
    ,
    char* splitter = null
    )
  2. char split(inout(char*) ptr, inout(char)[] before, inout(char)* after)

Parameters

match

An expression that matches all characters around which a split should occur.

str inout(char[])

The string to scan.

before inout(char)[]

The part before the split is stored here. If no character in match is found, the original string is returned here.

after inout(char)[]

The part after the split is stored here. If no character in match is found, null is returned here.

splitter char*

If not null, this pointer will receive a copy of the splitting char.

Return Value

Type: bool

true, iff a split occured.

Meta