I need to use an arraylist because I don't know how many entries will be going into my array. In my calling routine I have
string[] myStringArray = functionName(arg1,arg2)
in the function I build the arraylist and then have
} return myArraylist.ToArray();
I have a type mismatch between object and string. I'm guessing I need to cast somewhere but I can't figure out where or how. I could simply create a string[] and populate it and return it - but I'm trying to learn C# here. That will never happen if I choose to do inefficient hacks that work but don't allow me to discover how things should be done.
Thanks!
string[] myStringArray = functionName(arg1,arg2)
in the function I build the arraylist and then have
} return myArraylist.ToArray();
I have a type mismatch between object and string. I'm guessing I need to cast somewhere but I can't figure out where or how. I could simply create a string[] and populate it and return it - but I'm trying to learn C# here. That will never happen if I choose to do inefficient hacks that work but don't allow me to discover how things should be done.
Thanks!