C#,asp.net去除字符串前后空格,Trim()

用Trim()方法就可以了:

String s = " 去掉空格   ";
s = s.Trim();
原文地址:https://www.cnblogs.com/henw/p/2045566.html