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

用Trim()方法就可以了:

String s = " 去掉空格   ";
s = s.Trim();
posted @ 2011-05-13 15:22  hen  阅读(11364)  评论(0编辑  收藏  举报