I have a problem with my array.
My array name is word[3] have 3 items.
word[0] = "Listen Repeat"
word[1] = "Tune"
word[2] = "Landing Page"
I want words[0] split new two item and add to exist item in array.
words = Regex.Split(words[0], @"\s{1,}").Where(x => !string.IsNullOrEmpty(x)).ToArray();
So, my array becomes like:
word[0] = "Listen"
word[1] = "Repeat"
But I want my array like:
word[0] = "Listen"
word[1] = "Repeat"
word[2] = "Tune"
word[3] = "Landing Page"
Note: If using add two arrays, this arrays not sort. You can see my next item in array like:
word[0] = "Listen"
to
word[1] = "Repeat"
to
word[2] = "Tune"
to
word[3] = "Langding Page"
If I using AddRange this will like:
from
word[0] = "Listen"
to
word[1] = "Tune"
to
word[2] = "Langding Page"
to
word[3] = "Repeat"
This code will delete exist item and create new arrays with two items. I don't know how to add exist array.
I tried with Append but it not success.
Append... There are many questions discussion adding/replacing items in array / merging arrays in all possible ways. Make sure to provide results of your research as links with sample code that did not work (see minimal reproducible example for guidance on code samples).word[0] = "Listen"toword[1] = "Repeat". If I usingAddRangethis will like:word[0] = "Listen"toword[1] = "Tune"toword[2] = "Langding Page"toword[3] = "Repeat"