c# 字符串不确定是否为null去掉前后空格 之前用的Convert.ToString(str).Trim(),以为str为null时返回的"",但还是返回的null,只能写成str==null?null:str.Trim(),然后vs提示可以简写,就是str?.Trim()了