I have a code, which makes an array for all the letters used in a txt file, named "failas.txt":
using System;
using System.Linq;
using System.Globalization;
using System.Collections.Generic;
using System.Collections;
using System.IO;
using System.Text;
class Program
{
static void Main()
{
string failas = "failas.txt";
string rodymas = File.ReadAllText(failas, Encoding.GetEncoding(1257));
Console.OutputEncoding = Encoding.UTF8;
Console.WriteLine(rodymas);
char[] masyvas = rodymas.ToArray().Reverse().Where(c => !char.IsWhiteSpace(c)).ToArray();
foreach (char c in masyvas)
{
Console.Write(c + ",");
}
Console.ReadLine();
}
}
It reverses the array. However I need it not to reverse, but sort it in alphabetical order and exclude symbols like ,
, .
, :
, "
, etc. basically exclude everything that is not a letter.