RosettaCodeData/Task/String-matching/K/string-matching-2.k

15 lines
225 B
Plaintext

startswith["abcd";"ab"]
1
startswith["abcd";"bc"]
0
endswith["abcd";"cd"]
1
endswith["abcd";"bc"]
0
contains["abcdef";"cde"]
1
contains["abcdef";"bdef"]
0
_ss["abcdabceabc";"abc"] / location of matches
0 4 8