如果表格行为空,我的文本框中会出现此空格“”的问题。所以我想用这个“
”替换这个“”。例如,这就是我所拥有的:
StartTime.Text = row.Cells[5].Text;
所以这里是我想要实现的伪代码:
if (StartTime.Text == "" " then replace it with " ")
else show the value of StartTime.Text
我知道我的C#技能太差了所以请帮忙。感谢
答案 0 :(得分:8)
StartTime.Text = row.Cells[5].Text.Replace(" ", " ")
或者我没有正确理解这个问题