public void GetCountVowelsWords(string _path) { string[] words = FileController.Read_File(_path).Split(_spearator, StringSplitOptions.RemoveEmptyEntries); ConsoleColorOutput.Output_Yellow("__Words from file : __"); foreach (string _word in words) { int _tempCountSimbols = 0; ConsoleColorOutput.Output_Usual(_word); foreach (char _simbol in _word) { if (Array.Find(_vowelsWords, s => s == _simbol) != default(char)) { _tempCountSimbols++; } } if (_tempCountSimbols == _word.Length) { _numberVowelsWords++; } } ConsoleColorOutput.Output_Yellow("__Count Vowels words : __"); ConsoleColorOutput.Output_Green(_numberVowelsWords); }
public static void Validate() { ConsoleColorOutput.Output_Yellow("Please enter full path to your text file."); FilePath = Console.ReadLine(); Check(); }
public static void Create_File() { ConsoleColorOutput.Output_Yellow("Enter directory name"); DirectoryName = Console.ReadLine(); Directory.CreateDirectory($@"C:\{DirectoryName}"); ConsoleColorOutput.Output_Yellow("Enter file name"); FileName = Console.ReadLine(); FileFullPath = $@"C:\{DirectoryName}\{FileName}.txt"; using (FileStream fs = File.Create(FileFullPath)) { byte[] info = new UTF8Encoding(true).GetBytes($"This file is created dynamically."); fs.Write(info, 0, info.Length); } ConsoleColorOutput.Output_Green($"File created with path : {FileFullPath}"); }