I created an array like this:
string[] test = new string[]{"apple", "banana", "tomato", "pineapple", "grapes"};
And now I would like to take the 2nd, 3rd and 4th positions in the array and merge, I am currently using this code:
string result = ""; for(int i = 1; i < 4; i++) { result += test[i] + " "; }
So the result would be banana tomato pineapple , and this works great.
And I would like to ask if there is a standard or better way to achieve this?
arrays c #
User2012384
source share