替换所有空格

Entity.Name = Regex.Replace(dt.Rows[i]["行政值日"].ToString().Trim().Replace(" ", "").Replace(" ", ""), @"\s", "");
                        Entity.Riqi = dt.Rows[i]["日期"].ToString().Trim().ToDateTime().ToString("yyyyMMdd");
                        Entity.Leader = Regex.Replace(dt.Rows[i]["行政值日"].ToString().Replace(" ","").Replace(" ","").Trim(), @"\s", "");
                        Entity.Teacher = Regex.Replace(dt.Rows[i]["老师值日"].ToString().Trim(), @"\s", "");

 

posted @ 2017-03-13 12:35  shiningrise  阅读(201)  评论(0编辑  收藏  举报
// 侧边栏目录 // https://blog-static.cnblogs.com/files/douzujun/marvin.nav.my1502.css