A single-dimensional array of strings is defined as:
string[] countries = { "Ghana", "Rwanda",
"Egypt", "Ethiopia",
"Niger" };
And in memory it looks like:
This memory layout looks similar to the layout of a jagged Char array. A C# Jagged Array is an array of arrays. Although a string in C# is not an Array yet conceptually it is an array of Char types. According to MSDN a string is a sequential read-only collection of Char objects. It is for this reason that the memory layout of string array ( string[ ] ) looks like a jagged Char array ( Char[ ][ ] ). Here is a question related to above string array:
We want to join the first character of all the country names in 'countries' to get a new string ( 'GREEN' ). We have a partial implementation of the requirement:
string green = null;
for(int s=0; s < countries.Length; s++)
green += _____;
Which one of below choices should replace the blank ( _____ ) to complete the above implementation?