private string[] ColeccionDeCortes(string Path)
{
DirectoryInfo X = new DirectoryInfo(Path);
FileInfo[] listaDeArchivos = X.GetFiles();
string[] Coleccion;
foreach (FileInfo FI in listaDeArchivos)
{
//Add the FI.Name to the Coleccion[] array,
}
return Coleccion;
}
I'd like to convert the FI.Name
to a string and then add it to my array. How can I do this?
This is how I add to a string when needed:
Alternatively, you can resize the array.
This code works great for preparing the dynamic values Array for spinner in Android:
If I'm not mistaken it is:
You can't add items to an array, since it has fixed length, what you're looking for is a
List<string>
, which can later be turned to an array usinglist.ToArray()
.