ok this is frazzling my head right now. ok lets get started, i have a listbox which its items are representing file paths. so for example, it may contain the following items:
"C:\Windows\Delphi\My Folder\Folder1"
"C:\Windows\Delphi\My Folder\Folder2"
"C:\Windows\Delphi\My Folder\Folder3"
"C:\Windows\Delphi\My Folder\Folder4"
the important thing to know here is that, after "C:\Windows\Delphi\" the strings could be anything.
what im trying to do is trim/delete/extract whichever each listbox item to get the values after "C:\Windows\Delphi\".
so i basically need to get these:
"C:\Windows\Delphi\My Folder\Folder1"
"C:\Windows\Delphi\My Folder\Folder2"
"C:\Windows\Delphi\My Folder\Folder3"
"C:\Windows\Delphi\My Folder\Folder4"
to look this:
"\My Folder\Folder1"
"\My Folder\Folder2"
"\My Folder\Folder3"
"\My Folder\Folder4"
ive tried Trim, TrimLeft, TrimRight, StringReplace and im baffled, im confusing myself and am getting annoyed. its fairly easy im sure, but im having slipping up somewhere.
Please help!!!
Thanks
"C:\Windows\Delphi\My Folder\Folder1"
"C:\Windows\Delphi\My Folder\Folder2"
"C:\Windows\Delphi\My Folder\Folder3"
"C:\Windows\Delphi\My Folder\Folder4"
the important thing to know here is that, after "C:\Windows\Delphi\" the strings could be anything.
what im trying to do is trim/delete/extract whichever each listbox item to get the values after "C:\Windows\Delphi\".
so i basically need to get these:
"C:\Windows\Delphi\My Folder\Folder1"
"C:\Windows\Delphi\My Folder\Folder2"
"C:\Windows\Delphi\My Folder\Folder3"
"C:\Windows\Delphi\My Folder\Folder4"
to look this:
"\My Folder\Folder1"
"\My Folder\Folder2"
"\My Folder\Folder3"
"\My Folder\Folder4"
ive tried Trim, TrimLeft, TrimRight, StringReplace and im baffled, im confusing myself and am getting annoyed. its fairly easy im sure, but im having slipping up somewhere.
Code:
for i:= 0 to MasterFileBufferList.Items.Count -1 do
begin
oldPath:= ExtractFilePath(ExcludeTrailingPathDelimiter(MasterFileBufferList.Items.Strings[i]));
oldPath:= TrimRight('\My Folder\Folder4');
end;
Please help!!!
Thanks