From 5b1960859fcc6331a486ced98c5f25d93168fa18 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Mon, 20 May 2024 15:19:31 -0400 Subject: Hook up Text.has(), Text.trimmed(), Text.without() --- test/text.tm | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'test/text.tm') diff --git a/test/text.tm b/test/text.tm index 9c451b89..9df48467 100644 --- a/test/text.tm +++ b/test/text.tm @@ -55,3 +55,40 @@ func main(): >> "Hello":replace("e", "X") = "HXllo" + + >> "Hello":has("l") + = yes + >> "Hello":has("l", End) + = no + >> "Hello":has("l", Start) + = no + + >> "Hello":has("o") + = yes + >> "Hello":has("o", where=End) + = yes + >> "Hello":has("o", where=Start) + = no + + >> "Hello":has("H") + = yes + >> "Hello":has("H", End) + = no + >> "Hello":has("H", Start) + = yes + + >> "Hello":without("l") + = "Heo" + >> "xxxx":without("x") + = "" + >> "xxxx":without("y") + = "xxxx" + >> "One two three four five six":without("e ") + = "Ontwo threfour fivsix" + + >> " one ":trimmed() + = "one" + >> " one ":trimmed(" aeiou") + = "n" + + >> amelie:has(amelie2) -- cgit v1.2.3