c# - How do I store an array of strings into another array of strings? -
i'm trying store old array of struct type holds first names of people new string array has been downsized can shuffle round in method.
string[] newstringarray = new string[10] (int = 0; < oldstringarray.length; i++) { newstringarray = oldstringarray[i].firstname;//cannot convert type 'string 'string[]' } foreach (string value in newstringarray) { console.writeline(value); }
it looks forgot index accessor:
string[] newstringarray = new string[10]; (int = 0; < oldstringarray.length && < newstringarray.length; i++) { newstringarray[i] = oldstringarray[i].firstname; // ^ }
Comments
Post a Comment