private static string BuildShoutedPart(IEnumerable <string> names) { var shoutedNames = names.Where(n => n.IsUpperCased()).ToArray(); var greeted = ListFormatter.FormatList(shoutedNames); return(shoutedNames.Any() ? $"{Welcome} {greeted}!".ToUpperInvariant() : ""); }
private static string BuildSpokenPart(IEnumerable <string> names) { var spokenNames = names.Where(n => !n.IsUpperCased()).ToArray(); var greeted = ListFormatter.FormatList(spokenNames); return(spokenNames.Any() ? $"{Welcome}, {greeted}." : ""); }