您当前的位置: 首页 >  c#

衣舞晨风

暂无认证

  • 0浏览

    0关注

    1156博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

C# 字符串中多个连续空格转为一个空格

衣舞晨风 发布时间:2015-06-17 08:17:52 ,浏览量:0

   #region 字符串中多个连续空格转为一个空格
        /// 
        /// 字符串中多个连续空格转为一个空格
        /// 
        /// 待处理的字符串
        /// 合并空格后的字符串
        public static string MergeSpace(string str)
        {
            if (str != string.Empty &&
                str != null &&
                str.Length > 0
                )
            {
                str = new System.Text.RegularExpressions.Regex("[\\s]+").Replace(str, " ");
            }
            return str;
        }


        #endregion
关注
打赏
1647422595
查看更多评论
立即登录/注册

微信扫码登录

0.0420s