static string[] myFriends = new string[] {"Robert","Andrew","Leona","Ashley"};
How do I go about pulling the names from this static string array, so that I can use them separately on different lines? Such as:
Robert is sitting in chair 1
Andrew is sitting in chair 2
Leona is sitting in chair 3
Ashley is sitting in chair 4
I'm guessing I would have to assign them to values, then in a WriteLine Command, I would input {1}, {2}, {3} etc. for each corresponding name?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Friends
{
class Program
{
public void count(int inVal)
{
if (inVal == 0)
return;
count(inVal - 1);
Console.WriteLine("is sitting in chair {0}", inVal);
}
static void Main()
{
Program pr = new Program();
pr.count(4);
}
static string[] myStudents = new string[] {"Robert","Andrew","Leona","Ashley"};
}
}
I want to add the names to the "is sitting in chair" line.