RosettaCodeData/Task/String-matching/Aime/string-matching.aime

23 lines
524 B
Text
Raw Permalink Normal View History

2019-09-12 10:33:56 -07:00
text t;
2015-02-20 09:02:09 -05:00
data b;
2019-09-12 10:33:56 -07:00
b = "Bangkok";
2015-02-20 09:02:09 -05:00
2019-09-12 10:33:56 -07:00
t = "Bang";
2015-02-20 09:02:09 -05:00
2019-09-12 10:33:56 -07:00
o_form("starts with, embeds, ends with \"~\": ~, ~, ~\n", t, b.seek(t) == 0,
b.seek(t) != -1,
b.seek(t) != -1 && b.seek(t) + ~t == ~b);
2015-02-20 09:02:09 -05:00
t = "ok";
2019-09-12 10:33:56 -07:00
o_form("starts with, embeds, ends with \"~\": ~, ~, ~\n", t, b.seek(t) == 0,
b.seek(t) != -1,
b.seek(t) != -1 && b.seek(t) + ~t == ~b);
2015-02-20 09:02:09 -05:00
t = "Summer";
2019-09-12 10:33:56 -07:00
o_form("starts with, embeds, ends with \"~\": ~, ~, ~\n", t, b.seek(t) == 0,
b.seek(t) != -1,
b.seek(t) != -1 && b.seek(t) + ~t == ~b);