<div dir="auto"><div><div class="gmail_quote"><div dir="ltr">Bart <<a href="mailto:bartjunk64@gmail.com">bartjunk64@gmail.com</a>> schrieb am Sa., 29. Sep. 2018, 22:50:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
Consider this example:<br>
<br>
program split;<br>
{$mode objfpc}<br>
{$h+}<br>
<br>
uses<br>
sysutils;<br>
<br>
var<br>
S: string;<br>
A: TStringArray;<br>
i: Integer;<br>
<br>
begin<br>
S := '1 2 3 4 5';<br>
A := S.Split([#32],'"');<br>
writeln('S = ',S,', Separators = #32');<br>
for i := Low(A) to High(A) do writeln(format('%d: "%s"',[i,A[i]]));<br>
writeln;<br>
<br>
S := '1\n2\n3\n4\n5';<br>
A := S.Split(['\n'],'"');<br>
writeln('S = ',S,', Separators = \n');<br>
for i := Low(A) to High(A) do writeln(format('%d: "%s"',[i,A[i]]));<br>
end.<br>
<br>
Output:<br>
S = 1 2 3 4 5, Separators = #32<br>
0: "1"<br>
1: "2"<br>
2: "3"<br>
3: "4"<br>
4: "5"<br>
<br>
S = 1\n2\n3\n4\n5, Separators = \n<br>
0: "1"<br>
1: "2"<br>
2: "3"<br>
3: "4"<br>
<br>
I would expect the output would be the same for both versions of split?<br>
The "string" version misses the last one?<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Please report as bug. </div><div dir="auto"><br></div><div dir="auto">Regards, </div><div dir="auto">Sven </div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
</blockquote></div></div></div>