Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.net 从FreeTextBox中剥离非中断空格_.net_Regex_Freetextbox - Fatal编程技术网

.net 从FreeTextBox中剥离非中断空格

.net 从FreeTextBox中剥离非中断空格,.net,regex,freetextbox,.net,Regex,Freetextbox,我以前从来没有遇到过这个问题,我被难住了。使用FTB,无法找到从sql2008r2的文本输入和输出中去除不间断空格()的方法。我已经用常规的文本框和文本区域做了很多次了,但我已经做了很多次了。我在页面上尝试了简单的replace(string,“,”),但运气不好,我更喜欢使用正则表达式。而且,这两项工作都没有: Regex.Replace(endStr, "(Â){1,999}", "", RegexOptions.IgnoreCase); Regex.Replace(endStr, "(&

我以前从来没有遇到过这个问题,我被难住了。使用FTB,无法找到从
sql2008r2
的文本输入和输出中去除不间断空格(
)的方法。我已经用常规的文本框和文本区域做了很多次了,但我已经做了很多次了。我在页面上尝试了简单的
replace(string,“,”)
,但运气不好,我更喜欢使用正则表达式。而且,这两项工作都没有:

Regex.Replace(endStr, "(Â){1,999}", "", RegexOptions.IgnoreCase);

Regex.Replace(endStr, "( ){1,999}", "", RegexOptions.IgnoreCase);

没关系,我发现了这个,而且效果很好:

Regex.Replace(endStr, "\s+", " ",  RegexOptions.IgnoreCase);

\如果您的文本框要处理亚洲语言,因为它们的间距字符不同于标准的Unicode值,那么p{Z}+应该会工作得更好。

您可以回答这个问题,如果它有效,您可以接受自己的答案。