I am creating a small app that reads in a text file (stored as a string array) and sorts the contents by a simple key press. How can I assign a character eg. 'f' to show a certain array? For example I simply press 'f' and the console displays the first names of my text file i.e array[0]. Here is a snippet:
//Console Read Key method???
//
if (key.KeyChar == 'f')
{
Console.WriteLine(strArray[0]);
}
I realise there's lots of content on SO to do with this but nothing has been useful. It's a simple issue I can't work out! Don't worry about the sorting I simply need a specific array to show. Thanks for any help