Capy-Bearer Documentation

nibble

lib call

Capy

function nibble(haystack : string, delim : string) string

Description

nibble() returns the text before the first delim.

It does not change haystack. If delim does not occur, it returns all of haystack.

Parameters

haystack : the string to split

delim : the delimiter

Return Values

the text before the first delimiter

Example

Capy

var path := "docs/index"
print(nibble(path, "/"), "\n")