18 lines
635 B
Plaintext
18 lines
635 B
Plaintext
:sig
|
|
String nibble(String& haystack, String delim)
|
|
|
|
:params
|
|
haystack : string to be nibbled at
|
|
delim : delimiter
|
|
return value : string before first occurrence of 'delim'
|
|
|
|
:desc
|
|
Returns the part of 'haystack' before the first occurrence of 'delim', removing the corresponding part from 'haystack' (including 'delim'). If the substring 'delim' does not occurr in 'haystack', the entire string is returned and 'haystack' is set to an empty string.
|
|
|
|
:see
|
|
>string
|
|
|
|
:related
|
|
**PHP:** Small parsing helpers built with `strpos()`, `substr()`, and `explode()`
|
|
**JavaScript / Node.js:** Manual parsing with `indexOf()`, `slice()`, and `split()`
|