var i:integer; date:sting; function findNUM(s:string):string; begin begin date:=' '; for i:=1 to length(s) do begin if (s[i]>='0')and(s[i]<='9') then date:=date+s[i];//从字符串中取数字, end; end; end;
凑个热闹,再贴一个 procedure GetStr(const S:string;var str1,str2:string); var p:^char; i:integer; temp:string; begin temp:=''; for i:=1 to length(S) do begin p:=@S[i]; case p^ of '(':begin str1:=temp; temp:=''; end; ')':str2:=temp; else temp:=temp+P^; end; end; end;
Str :AnsiString;
i : Integer;
begin
Str := aaaa(bb);
i := Pos(Str);
str1 := Copy(Str,1,i-1);
str2 := Copy(Str,i+1,length(Str)- length(str1)-2);
end;以上代码没经过测试!
Str1 := copy(s,1,pos('(',s) - 1);
Str2 := copy(s,pos('(',s) + 1,pos(')',s) - pos('(',s) - 1);
function findNUM(s:string):string;
begin
begin
date:=' ';
for i:=1 to length(s) do
begin if (s[i]>='0')and(s[i]<='9')
then
date:=date+s[i];//从字符串中取数字,
end;
end;
end;
procedure GetStr(const S:string;var str1,str2:string);
var
p:^char;
i:integer;
temp:string;
begin
temp:='';
for i:=1 to length(S) do
begin
p:=@S[i];
case p^ of
'(':begin
str1:=temp;
temp:='';
end;
')':str2:=temp;
else
temp:=temp+P^;
end;
end;
end;