我的github

1. 替换字符串中的空格

 string mStr= str.Replace( " ", "" ); 

2. 替换字符串中的:空格, tab字符, 换行符和新行(“ ”,“\t","\n","\r")

string mStr= Regex.Replace( str, @"\s", "" );

参考1:https://blog.csdn.net/octdream/article/details/78316371

参考2:https://www.cnblogs.com/xigua55/p/14849375.html

posted on 2022-07-13 11:06  XiaoNiuFeiTian  阅读(360)  评论(0编辑  收藏  举报