• winform 剔除空格与换行显示


    string strTeachingPlan = this.txtTeachingPlan.Text.ToString().Trim(); 
    string[] maarr = strTeachingPlan.Split(' '); //文本中隐含的回车换行符给去掉 每行末尾加上换行符" " 保存到数据库
                    string strText = string.Empty;
                    for (int i = 0; i < maarr.Length; i++)
                    {
                        if (string.IsNullOrEmpty(maarr[i].ToString()))
                        {
                            continue;
                        }
                        strText += maarr[i].ToString() + " ";
                    }

    查询时 将 " " 替换为 " "
     this.txtTeachingPlan.Text = dt.Rows[0]["TeachingPlan"].ToString().Replace( " "," ");

    Environment.NewLine; 获得环境中的定义的换行字符串 (保持平台的通用性)

  • 相关阅读:
    sqlldr、sqluldr2_w64案例
    查看oracle的sid和sevice_name
    杂记
    GAN学习
    Leetcode 第 217 场周赛
    牛客编程巅峰赛S2第4场
    SAR图像变化检测的一点想法
    Fire! UVA
    HDU
    HDU
  • 原文地址:https://www.cnblogs.com/quanxie/p/3154963.html
Copyright © 2020-2023  润新知