Probiers mal mit [Gemütlichkeit, mit Ruhe und Gelassenheit...]
Delphi-Quellcode:
procedure TextArrayToAssStringList(const Text: string; Delimiter: Char; List: TStrings);
var
F, P: PChar;
Name, Value: string;
begin
P := PChar(Text);
while P[0] <> #0 do
begin
F := P;
while (P[0] <> #0) and (P[0] <> Delimiter) do Inc(P);
SetString(Name, F, P - F);
if P[0] <> #0 then
begin
Inc(P);
F := P;
while (P[0] <> #0) and (P[0] <> Delimiter) do Inc(P);
SetString(Value, F, P - F);
end
else
Value := '';
List.Add(Name + '=' + Value);
end;
end;
...
var List: TStrings;
begin
List := TStringList.Create;
try
TextArrayToAssStringList('myname\myvalue\yourname\yourvalue', List, '\');
if List.Values['myname'] = 'myvalue' then
ShowMessage('Gefunden');
finally
List.Free;
end;
end;