Getting an element in Array<File> into a String

I am using findChildFiles to get files into an Array of type , like below;

File f ("d:/documents/development/");
Array<File> waveformList;
waveformList = f.findChildFiles (2, false, "*.wav");

My question is how do I now get one of the array elements into a string?

String test = String (waveformList[0]); // Won't work!

The File object contains the member functions getFullPathName() and getFileName(). I assume one of those is what you need?

1 Like

And I did look into both of those, but were unable to match up the correct syntax for either.

String test = File::getFileName (waveformList[0]); // Won't work

Ok I think I got it;

String test =  waveformList[0].getFileName();