Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
16
Task/String-matching/Seed7/string-matching.seed7
Normal file
16
Task/String-matching/Seed7/string-matching.seed7
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
$ include "seed7_05.s7i";
|
||||
|
||||
const proc: main is func
|
||||
local
|
||||
var integer: position is 0;
|
||||
begin
|
||||
writeln(startsWith("abcd", "ab")); # write TRUE
|
||||
writeln(endsWith("abcd", "zn")); # write FALSE
|
||||
writeln(pos("abab", "bb") <> 0); # write FALSE
|
||||
writeln(pos("abab", "ab") <> 0); # write TRUE
|
||||
writeln(pos("abab", "bb")); # write 0
|
||||
position := pos("abab", "ab");
|
||||
writeln(position); # position is 1
|
||||
position := pos("abab", "ab", succ(position));
|
||||
writeln(position); # position is 3
|
||||
end func;
|
||||
Loading…
Add table
Add a link
Reference in a new issue