- multimethod

Methods

-(a:Real, b:Real)
Subtraction
-(a:Int, b:Int)
Subtraction
-(a:Arr, b:Arr) Source: stdlib.ngs:1707
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:5325
Return string without the prefix. Throws MatchFail 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")  # MatchFail exception
"abcde" - MaybePfx("xy")  # "abcde"
-(s:Str, sfx:Sfx) Source: stdlib.ngs:5343
Return string without the suffix. Throws MatchFail 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")  # MatchFail exception
"abcde" - MaybeSfx("xy")  # "abcde"
-(s:Str, r:RegExp) Source: stdlib.ngs:5536
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