Ifx type

Infix subsequence of a sequence

Direct parent types

SubSeq
Undocumented
Direct subtypes: 3

Direct children types

MaybeIfx
Infix that might or might not be present for (-) to succeed
MustIfx
Infix that must be present for ~ matching to succeed

Constructors

Ifx(val:Any) Source: stdlib.ngs:5601
Convenience method for creating MustIfx

Returns

MustIfx

Methods

-(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, i:Ifx) Source: stdlib.ngs:5676
Check whether s contains i. Same as s ~ i.val

Returns

MatchResult