Pack the string with a MEMO
Procedure TForm1. Button1Click (Sender: TObject);
Var
STR, count1: string;
Ts: Tstringlist;
The begin
STR:=memo1. Text;
Ts:=Tstringlist. Create;
Ts. The Delimiter:='|';
Ts. DelimitedText:=Str;
Count1:=inttostr (ts. Count - 1);
Showmessage (count1);
end;
According to the results of the solution is 4? !!!!!
Ts [0] is'
'Ts [1] is 4 # # 8618210910127 # 24 Acct: 0011
Ts [2] is Zone: 11113009
Ts [3] is Event: Burglary
Ts [4] is 17/08/04 21:40:11 5:26:17 # 17-06-04
If is adjacent Numbers and letters will be split
CodePudding user response:
A total of five columnsTs. The Count should be 5
Count1:=inttostr (ts. Count - 1);//minus 1, the result is of course the 4
CodePudding user response:
.Ts. The Delimiter:='|';
Ts. Text:=Str;
Should be what you want