public static void DisplayMostUsedCharacters(string sentence) { var chars = sentence.StripAll(); var mostUsed = GetMostUsedChar(chars).Key; var mostUsedCount = GetMostUsedChar(chars).Count(); ConsoleFactory.Log($"Most used character: {mostUsed} ({mostUsedCount} times)"); }
public static void DisplayMostUsedWord(string sentence) { var words = sentence.RemoveExtraSpaces().RemoveBreakReturns(); var mostUsed = GetMostUsedWord(words).Key; var mostUsedCount = GetMostUsedWord(words).Count(); ConsoleFactory.Log($"Most used word: {mostUsed} ({mostUsedCount} times)"); }
public static void DisplayTotalCharacters(string sentence) { var chars = sentence.RemoveBreakReturns(); ConsoleFactory.Log($"Total Characters: {chars.Length}"); }
public static void DisplayCharacterCount(string sentence) { var chars = sentence.StripAll(); ConsoleFactory.Log($"Character count (minus line returns and spaces): {chars.Length}"); }
public static void DisplayTotalWords(string sentence) { var words = sentence.RemoveExtraSpaces().Split(' '); ConsoleFactory.Log($"Total Words: {words.Length}"); }