using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ch5_8
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            bool var1 = true;
            float var2 = 2.22F;
            string var3 = "abcdef ";
            object[] var4 = { 3, 4.4, 'X' };
            label3.Text = "";
            StringBuilder str1 = new StringBuilder();
            StringBuilder str2 = new StringBuilder();
            str1.Append(textBox1.Text);
            str2.Append(textBox2.Text);
            label3.Text += "str1 = " + str1 + "\n";
            label3.Text += "str2 = " + str2 + "\n";
            str1.Append(" ");
            str1.Append(var2);
            label3.Text += "Append float number : " + str1 + "\n";
            str2.Append(" ");
            str2.AppendFormat("{0} {1} {2}", var4);
            label3.Text += "AppenfFormat : " + str2 + "\n";
            str2.Append(" ");
            str2.Insert(0, var1);
            label3.Text += "Insert bool value : " + str2 + "\n";
            str2.Replace("True", var3);
            label3.Text += "Replace : " + str2 + "\n";
            label3.Text += "new str1 = " + str1.ToString() + "\n";
            label3.Text += "new str2 = " + str2.ToString() + "\n";
            label3 .Text += "Compare str1 with str2 :";
            if (str1.ToString().CompareTo(str2.ToString()) == 0)
                label3.Text += "str1 = str2";
            else if (str1.ToString().CompareTo(str2.ToString()) > 0)
                label3.Text += "str1 > str2";
            else
                label3.Text += "str1 < str2";
        }
    }
}
