Код: Выделить всё
public override void Select()
{
StringBuilder sb = new StringBuilder($"{MenuText()}{Environment.NewLine}");
int i = 1;
foreach (string file in _reader.paths)
{
sb.AppendLine($"{i}. {file}");
i++;
}
Console.WriteLine(sb.ToString());
int selectedIndex = ConsoleHelpers.GetIntegerInRange(1, _reader.paths.Count, MenuText()) - 1;
string[] result = File.ReadAllLines(_reader.paths[selectedIndex]);
if (result.Length == 0)
{
Console.WriteLine("Cannot open file - No data found");
}
else if (result.Length > 0)
{
string[] splitArray;
foreach (string file in result)
{
splitArray = file.Split(':').Select(s => s.Trim()).ToArray();
splitArray = splitArray.Where(x => !string.IsNullOrEmpty(x)).ToArray();
}
}
}
}
}
Подробнее здесь: https://stackoverflow.com/questions/787 ... etely-rest