Demo entry 6717110

1

   

Submitted by anonymous on Feb 23, 2018 at 03:09
Language: C#. Code size: 1.0 kB.

 public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string a = "*****";
            for (int i = 0; i < 5; i++)
            {
                textBox1.AppendText(a.Substring(4 - i));
                textBox1.AppendText("\n");
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            String a = "*****";
            for (int i = 0; i < 5; i++)
            {
                textBox2.AppendText(a.Substring(i));
                textBox2.AppendText("\n");
            }

        }

        private void button3_Click(object sender, EventArgs e)
        {
            string a = "*****";
            for (int i = 0; i < 5 * 2 - 1; i++)
            {
                string b = (i < 5) ? a.Substring(5 - 1 - i) : a.Substring(i - 5 + 1);
                textBox3.AppendText(b);
                textBox3.AppendText("\n");

            }
        }

This snippet took 0.00 seconds to highlight.

Back to the Entry List or Home.

Delete this entry (admin only).