Link to home
Start Free TrialLog in
Avatar of Manuel Lopez-Michelone
Manuel Lopez-MicheloneFlag for Mexico

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)
ASKER CERTIFIED SOLUTION
Avatar of Ferruccio Accalai
Ferruccio Accalai
Flag of Italy image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Manuel Lopez-Michelone

ASKER

Wow! a fast answer!...  I was thinking in some char analysis. This trick is really clever. Thanks
best wishes
Manuel Lopez (lopem)
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;
Glad to have helped you :)

F68 ;-)