using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Windows.Forms;

namespace Example41

{

    public partial class Form1 : Form

    {

        public Form1()

        {

            InitializeComponent();

        }

        private void textBox1_TextChanged(object sender, EventArgs e)

        {

            char[] P_chr = textBox1.Text.ToCharArray();  //从字符串中得到字节数组

            Array.Reverse(P_chr, 0, textBox1.Text.Length);   //反转字节数组

            textBox2.Text = new StringBuilder().Append(P_chr).ToString(); //将字节数组转换为字符串输出

        }

    }

}

posted on 2011-10-19 22:51  C#_初学者  阅读(552)  评论(0编辑  收藏  举报