1 2 {=== Copy a string within a string from sFrom (not included) to sTo (not included) 3 ===}4 function CopyFromTo(const sIn,sFrom,sTo:string):string;
5 var iPos:Integer;
6 begin7 Result := '';
8 ifnot (SameText(sIn,Result) or SameText(sFrom,Result) or SameText(sTo,Result))
9 thenbegin10 iPos := Pos(AnsiUpperCase(sFrom),AnsiUpperCase(sIn));
11 12 if iPos>0 thenbegin13 iPos := iPos+Length(sFrom);
14 Result := Copy(sIn,iPos,1+Length(sIn)-iPos);
15 16 iPos := Pos(AnsiUpperCase(sTo),AnsiUpperCase(Result));
17 if iPos>0 then Result := Copy(Result,1,iPos-1);
18 end;
19 end;
20 end;
21 //---------------------------------------------------------------------\\