split

Similar to the overload for strings, this function works a little faster as it lacks boundary checks. It assumes that one of the characters in match is actually contained in the string.

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

Parameters

match

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

ptr 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 pointer to the part after the split is stored here.

Return Value

Type: char

The char that caused the split. (From match.)

Meta