Beispiel #1
0
        private void sayHelloButton_Click(object sender, EventArgs e)
        {
            var names      = nameTextBox.Text;
            var namesArray = names.Split(' ').Select(n => n.Trim()).Where(n => !string.IsNullOrEmpty(n)).ToArray();
            var message    = Greeter.FormatGreeting(namesArray);

            MessageBox.Show(this, message, "Hello", MessageBoxButtons.OK);
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            var stringToPrint = Greeter.FormatGreeting(args);

            Console.WriteLine(stringToPrint);
        }