RosettaCodeData/Task/Substring/Seed7/substring.seed7

15 lines
350 B
Plaintext

$ include "seed7_05.s7i";
const proc: main is func
local
const string: stri is "abcdefgh";
const integer: N is 2;
const integer: M is 3;
begin
writeln(stri[N len M]);
writeln(stri[N ..]);
writeln(stri[.. pred(length(stri))]);
writeln(stri[pos(stri, 'c') len M]);
writeln(stri[pos(stri, "de") len M]);
end func;