1)Trim方法 string tt=" aaa "; tt=tt.Trim() 去字符串首尾空格的函数 tt=tt.TrimEnd() 去掉字符串尾空格 tt=tt.TrimStart() 去掉字符串首空格