1. 程式人生 > WINDOWS開發 >C# 字串反轉

C# 字串反轉

 private void button1_Click(object sender,EventArgs e)
        {
            char[] p_chr = text_input.Text.ToCharArray();
            Array.Reverse(p_chr,0,text_input.Text.Length);
            text_output.Text = new StringBuilder().Append(p_chr).ToString();
        }

主要用到reverse。