示例#1
0
        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() : "");
        }
示例#2
0
        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}." : "");
        }