diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-08-16 17:21:01 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-08-16 17:21:01 -0400 |
| commit | c72b0406a32ffc3f04324f7b6c321486762fca41 (patch) | |
| tree | 244e51c858890ea2ffb8c74a2c33c81b79de376e /man/man3/tomo-Text.ends_with.3 | |
| parent | 849fd423a759edf1b58b548a6148c177a6f8cd71 (diff) | |
Improved parsing and prefix/suffix matching using a `remainder`
parameter
Diffstat (limited to 'man/man3/tomo-Text.ends_with.3')
| -rw-r--r-- | man/man3/tomo-Text.ends_with.3 | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/man/man3/tomo-Text.ends_with.3 b/man/man3/tomo-Text.ends_with.3 index 7d19109b..38fa4c0b 100644 --- a/man/man3/tomo-Text.ends_with.3 +++ b/man/man3/tomo-Text.ends_with.3 @@ -2,14 +2,14 @@ .\" Copyright (c) 2025 Bruce Hill .\" All rights reserved. .\" -.TH Text.ends_with 3 2025-04-30 "Tomo man-pages" +.TH Text.ends_with 3 2025-08-16 "Tomo man-pages" .SH NAME Text.ends_with \- check suffix .SH LIBRARY Tomo Standard Library .SH SYNOPSIS .nf -.BI Text.ends_with\ :\ func(text:\ Text,\ suffix:\ Text\ ->\ Bool) +.BI Text.ends_with\ :\ func(text:\ Text,\ suffix:\ Text,\ remainder:\ &Text?\ =\ none\ ->\ Bool) .fi .SH DESCRIPTION Checks if the `Text` ends with a literal suffix text. @@ -24,6 +24,7 @@ l l l l. Name Type Description Default text Text The text to be searched. - suffix Text The literal suffix text to check for. - +remainder &Text? If non-none, this value will be set to the rest of the text up to the trailing suffix. If the suffix is not found, this value will be set to the original text. none .TE .SH RETURN `yes` if the text has the target, `no` otherwise. @@ -32,4 +33,9 @@ suffix Text The literal suffix text to check for. - .EX >> "hello world".ends_with("world") = yes +remainder : Text +>> "hello world".ends_with("world", &remainder) += yes +>> remainder += "hello " .EE |
