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:6902
Convenience method for creating MustSfx Returns
MustSfx
Methods
- -(s:Str, sfx:Sfx) Source: stdlib.ngs:6932
Return string without the suffix. Throws InvalidArgument 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") # InvalidArgument exception "abcde" - MaybeSfx("xy") # "abcde"
- ~(s:Str, sfx:Sfx) Source: stdlib.ngs:6980
Check whether s ends with sfx. Returns
MatchResultExample
"abcde" ~ Sfx("de") # <MatchSuccess matches=[de] pattern=<MustSfx de> before=abc after=> "abcde" ~ Pfx("xy") # <MatchFailure >