In the end I will finish this code. But I want to check how you will make it?
On the moment, i am stuck and I need to refresh myself. A pause.
The Problem enunciate like this:
I have many images that contain -pre and -fullview in the end of their names.
Some are the same image, some are diferent...it's a mess.
The -pre images are at low rezolution, but -fullview are max rezolution.
My program must sort -pre from -ful (i did it already with 2 lists).
then, erase -pre, IF image is the SAME name for -pre and -full.
Keep in mind there are also unique images that have pre but not full. Also, only -full images that dont have -pre to be clear out.
How would you deal with this ... shingle ?
Thank you.
Aham...I looked over the
stack element, but... i never worked seriously with it, so its hard for me to implement it at the moment. I mention about it, because maybe that is what i miss to do my life easier. You tell me.
What I have tried:
List<string> ImagesName = new List<string>();
ImagesName.AddRange(new string[] { "a.jpg", "a1-pre.jpg", "a1-fullview.jpg", "a2-pre.png", "a2-pre.png", "a3-fullview.jpg", "a3-fullview.jpg", "a4-fullview.jpg" });
List<string> Duplicates = new List<string>();
string pre = "-pre.", ful = "-fullview."; bool isX = true;
string link = "", LinkWithNoPre = "", dupelink = "";
List<string> linkWithPre = new List<string>();
List<string> linkWithFul = new List<string>();
for (int i = 0; i < ImagesName.Count; i++)
{
if (ImagesName[i].Contains(pre)) linkWithPre.Add(ImagesName[i]);
}
for (int i = 0; i < ImagesName.Count; i++)
{
if (ImagesName[i].Contains(ful)) linkWithFul.Add(ImagesName[i]);
}
for (int k = 0; k < ImagesName.Count; k++)
{
link = ImagesName[k];
if (link.Contains(pre))
{
int hu = link.IndexOf(pre);
LinkWithNoPre = link.Remove(hu, link.Length - hu);
for (int i = 0; i < linkWithPre.Count; i++)
{
link = linkWithPre[i];
if (link.Contains(LinkWithNoPre))
{
}
}
}
}