Manuel Lopez-Michelone
asked on
procedure to extract double quotes strings...
Hi guys,
I have this simple problem... Suppose I have some string with this format:
"01 Aguascalientes " "003 Calvillo " "33 Industrias de la madera y productos de madera. incluye muebles " "48 "
(note: this is a one long string)
I want to extract the double quotes strings to get in separated strings:
A = "01 Aguascalientes"
B = "003 Cavillo"
C = "33 Industrias de la madera y productos de madera. incluye muebles"
D = "48"
Anyone can help me?
best regards,
Manuel Lopez (lopem)
I have this simple problem... Suppose I have some string with this format:
"01 Aguascalientes " "003 Calvillo " "33 Industrias de la madera y productos de madera. incluye muebles " "48 "
(note: this is a one long string)
I want to extract the double quotes strings to get in separated strings:
A = "01 Aguascalientes"
B = "003 Cavillo"
C = "33 Industrias de la madera y productos de madera. incluye muebles"
D = "48"
Anyone can help me?
best regards,
Manuel Lopez (lopem)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
please see code below
procedure TForm1.Button1Click(Sender : TObject);
var
s:string;
sa:array [1..256] of String;
index:integer;
i:integer;
begin
s:='"a" "b" "c"';
index:=pos('" "',s);
i:=1;
while (index<>0) do
begin
sa[i]:=copy(s,1,index);
Inc(i);
s:=copy(s,index+Length('" "')-1,Length(s));
end;
end;
procedure TForm1.Button1Click(Sender
var
s:string;
sa:array [1..256] of String;
index:integer;
i:integer;
begin
s:='"a" "b" "c"';
index:=pos('" "',s);
i:=1;
while (index<>0) do
begin
sa[i]:=copy(s,1,index);
Inc(i);
s:=copy(s,index+Length('" "')-1,Length(s));
end;
end;
Glad to have helped you :)
F68 ;-)
F68 ;-)
ASKER
best wishes
Manuel Lopez (lopem)