pmcmicha
Technical User
- May 25, 2000
- 353
I am attempting to construct an array from a method, but I am receiving an error that the array must have an array size or array initializer. I thought the code below would do this, but it seems that C# is wanting more information up front, and I am not entirely sure what to give it. If I try to add "new string[] method", that does not work either.
Thanks in advance.
Code:
string[] testArray = testFunction(Directory);
public string[] BuildDirArr(string dirtoproc) {
[indent]string[] getAllDirs = Directory.GetDirectories(dirtoproc);[/indent]
[indent]// Do pattern matching on the directories here in a for loop, discarding those that do not match.[/indent]
[indent]//+ The for loop adds good directories to a list, then I do a list to array conversion before doing return.[/indent]
[indent]return(MatchingDirs);[/indent]
}
Thanks in advance.