trim方法问题
我要获取
dataGridView1.Rows[0].Cells[1].Value.ToString() 的值
可是这个里面有空格,如何去掉这个空格
dataGridView1.Rows[0].Cells[1].Value.ToString.trim()
这样不行
我开始用这个
string z;
z=dataGridView1.Rows[0].Cells[1].Value.ToString();
z.trim();
有没有别的办法?
[解决办法]
Repleace( " ", " ");
[解决办法]
dataGridView1.Rows[0].Cells[1].Value.ToString().Replace( " ",string.Empty);