Sfx type
Direct parent types
- SubSeq
Undocumented Direct subtypes: 3
Direct children types
- MaybeSfx
Suffix that might or might not be present for (-) to succeed
- MustSfx
Suffix that must be present for ~ matching to succeed
Constructors
- Sfx(val:Any) Source: stdlib.ngs:5313
Convenience method for creating MustSfx Returns
MustSfx
Methods
- -(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
s original string sfx suffix to get rid of Returns
s without pfxExample
"abcde" - Sfx("de") # "abc" "abcde" - Sfx("xy") # MatchFail exception "abcde" - MaybeSfx("xy") # "abcde"
- ~(s:Str, sfx:Sfx) Source: stdlib.ngs:5371
Check whether s ends with sfx. Returns
MatchExample
"abcde" ~ Sfx("de") # <MatchY matches=['de'] before=abc after=> "abcde" ~ Pfx("xy") # <MatchN >