Zoltan Kerenyi

Zoltan Kerenyi

  • NA
  • 72
  • 12.6k

string element lenght in List<>

Jun 26 2020 2:37 AM
Hi,
 
Is there an elegant way maybe LINQ to return True if all string element in a List is equal lenght? Or has a substring?
 
I was doing this way:
 
bool sha_ready = false;
            while (!sha_ready)
            {
                foreach (var item in Directory.GetFiles(destination_path, "*.wav"))
                {
                    if (!Path.GetFileName(item).ToLower().Contains("sha"))
                    {
                        sha_ready = false;
                    }
                    else
                    {

                    }
                }
            }
 
 
Thanks,
 
Zolee

Answers (3)