- multimethod

Methods

-(a:Real, b:Real)
Subtraction
-(a:Int, b:Int)
Subtraction
-(a:Arr, b:Arr) Source: stdlib.ngs:1845
Filter out all values in a that are also in b

Returns

Arr

Example

[1,2,3] - [5,6,1]  # [2,3]
-(s:Str, pfx:Pfx) Source: stdlib.ngs:5617
Return string without the prefix. Throws InvalidArgument if pfx is MustPfx but s does not start with it.

Parameters

soriginal string
pfxprefix to get rid of

Returns

s without pfx

Example

"abcde" - Pfx("ab")  # "cde"
"abcde" - Pfx("xy")  # InvalidArgument exception
"abcde" - MaybePfx("xy")  # "abcde"
-(s:Str, sfx:Sfx) Source: stdlib.ngs:5635
Return string without the suffix. Throws InvalidArgument if pfx is MustSfx but s does not end with it.

Parameters

soriginal string
sfxsuffix to get rid of

Returns

s without pfx

Example

"abcde" - Sfx("de")  # "abc"
"abcde" - Sfx("xy")  # InvalidArgument exception
"abcde" - MaybeSfx("xy")  # "abcde"
-(s:Str, ifx:Ifx) Source: stdlib.ngs:5652
Return string without the infix. Throws InvalidArgument if ifx is MustIfx but s does not contain it.

Parameters

soriginal string
ifxinfix to get rid of

Returns

s without ifx

Example

"abcde" - Ifx("bc")  # "ade"
"abcde" - Ifx("xy")  # InvalidArgument exception
"abcde" - MaybeIfx("xy")  # "abcde"
-(s:Str, r:RegExp) Source: stdlib.ngs:5848
Returns the string with one occurrence of regexp cut out of it. Throws InvalidArgument if s does not contain r.

Returns

Str

Example

"abc01def23" - /[0-9]+/  # "abcdef23"
-(a:Set, b:Set) Source: autoload/Set.ngs:46
Set difference

Returns

Set