2009年7月10日金曜日

split

function split(s: string; dot: Char): strArray; //AION ジケル RMT
var //アイオン(AION)
begin //google
i := 1;
j := 0;
SetLength(Str, 255);
while Pos(dot, s) > 0 do
begin
Str[j] := Copy(s, i, Pos(dot, s) - i);
i := Pos(dot, s) + 1;
s[i - 1] := Chr(Ord(dot) + 1);
j := j + 1;
if j > 250 then
Exit;
end;
Str[j] := Copy(s, i, StrLen(PChar(s)) - i + 1);
Result := Str;
end;