So I have an assigment for c# in which I need to work with text files, separate words at commas and other punctuation marks. I choose to do it like this:
string Book1 = "@\\..\\Knyga1.txt";
string punctuation = " ,.?!;:\"";
string Read1 = File.ReadAllText(Book1);
string[] FirstFileWords = Read1.Split(punctuation.ToCharArray());
But I've run into a problem... My text files are supposed to be like books, so obviously there's going to be multiple lines... is there any way to add "the enter key" or whatever we shall call the thing to make a new line (sorry for my bad english) one of the punctuation marks? Because when working with individual words later, for example printing out the longest words, words which are at the start of line 2 3 and so on take up two lines in the console.