码迷,mamicode.com
首页 > Windows程序 > 详细

C# 去掉代码前边空格(格式化代码)

时间:2018-07-11 20:07:59      阅读:247      评论:0      收藏:0      [点我收藏+]

标签:.text   box   span   color   str   col   格式   button   string   

        private void button1_Click(object sender, EventArgs e)
        {
            textBox2.Text = "";
            string str = "";
            foreach (string s2 in textBox1.Lines)
            {
                if(s2==""){
                    continue;
                }
                str += s2.Trim()+"\r\n";
            }
            textBox2.Text = str;
        }

 

C# 去掉代码前边空格(格式化代码)

标签:.text   box   span   color   str   col   格式   button   string   

原文地址:https://www.cnblogs.com/enych/p/9295839.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!