0

6个回答

procedure TForm1.Button1Click(Sender: TObject);
var s1,s2:string;
i,j,k:integer;
begin
S1:=Edit1.text;
S2:='';
for i:= 1 to length(S1) do
begin
if i=1
then begin
k:=0;
for j:=i to length(S1) do
begin
if (S1[j]='/') or (S1[j]=',') or (S1[j]='-') then
begin
k:=j;
Break;
end;
end;
if K>0 then S2:=Copy(S1,1,K-1);
end
else begin
if (S1[i-1]='/') or (S1[i-1]=',') or (S1[i-1]='-') then
begin
k:=0;
for j:=i to length(S1) do
begin
if (S1[j]='/') or (S1[j]=',') or (S1[j]='-') then
begin
k:=j;
Break;
end;
if (J=length(S1)) and (K=0) then k:=J+1;
end;
if K>0 then S2:=S2+' '+Copy(S1,i,K-i);
end;
end;
end;
Edit2.Text:=S2;
end;

0
``````procedure TForm1.Button1Click(Sender: TObject);
var s1,s2:string;
i,j,k:integer;
begin
S1:=Edit1.text;
S2:='';
for i:= 1 to length(S1) do
begin
if i=1
then begin
k:=0;
for j:=i to length(S1) do
begin
if (S1[j]='/') or (S1[j]=',')  or (S1[j]='-') then
begin
k:=j;
Break;
end;
end;
if K>0 then S2:=Copy(S1,1,K-1);
end
else begin
if (S1[i-1]='/') or (S1[i-1]=',') or (S1[i-1]='-') then
begin
k:=0;
for j:=i to length(S1) do
begin
if (S1[j]='/') or (S1[j]=',') or (S1[j]='-') then
begin
k:=j;
Break;
end;
if (J=length(S1)) and (K=0) then k:=J+1;
end;
if K>0 then S2:=S2+' '+Copy(S1,i,K-i);
end;
end;
end;
Edit2.Text:=S2;
end;

``````
0

0

0

0

0

delphi 字符串分割的问题

Delphi字符串分割使用Tstringlist示例

delphi字符串分割示例源码

delphi字符串按字符串分割
delphi字符串按字符串分割 Edit1aa1aa2 按aa分割结果 Edit1 1 2

rnstring s = "汉字123文字english";rnrn现在我想按照中文汉字来分割成string[]数组,并且保留此中文得到：rnrnstring[] arr = "汉字","123","文字","english";rnrn代码该怎么写？rnrn
delphi字符串分割函数整理

String s = "a,b,c,d,e";rnrn我想要str="abcde";rnrn怎么写?rnrn

delphi有没有自带的字符串分割函数

delphi如何解决以下问题！

“ C1 CHIP-135 6.54 79.25 0 T CHIP-135 ”rnrn面对怎样的字符串，应该怎样分割呢？
Delphi 自带的字符串分割函数split

if a="online.com" then rnrna1="online"rnrna2="com"rnrnif a="online.com.cn" thenrnrna1="online"rnrna2="comcn"rnrn当a等于其它时，能够自动分割出来。这个程序怎么写？感谢了！
＊＊＊＊字符串分割问题

///////////////////字符串分割问题 //////////////