So I have a string array called page and a string array called notesSplit which is created using notes.split().
notessplit could have a variable number of newlines however is never over 10 lines.
I'd like to overwrite the contents of "page" from index 20 - 30 leaving blank lines if the index does not exist in notessplit.
Any ideas?
var page = new string[44]; <-- actually this is from a text file
string notes = "blah \n blah \n";
string[] notesSplit = notes.Split(new string[] { Environment.NewLine }, StringSplitOptions.None);
What I have initially come up with is:
for (var i = 0; i < 9; i++)
{
if (notesSplit[i] != null)
{
Page[i + 20] = notesSplit[i];
} else {
Page[i + 20] = System.Environment.NewLine;
}
}