首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > C# >

怎么截取这样的字符串呢

2012-07-30 
如何截取这样的字符串呢?cell(1,1).text 爱\r\n情C# codestring str f.ListGrid.Cell(1, 1).Textstr

如何截取这样的字符串呢?
cell(1,1).text = "爱\r\n情"

C# code
string str = f.ListGrid.Cell(1, 1).Text;string str1, str2;  str1 = str.Substring(0, 1);str2 = str.Substring(1, 1);cell(2,2).Text = str1 + str2;  //希望此单元格的文字恢复成"爱情",水平依次排列 


如何取到第2个字符"情"呢?

[解决办法]
C# code
string str = f.ListGrid.Cell(1, 1).Text.Replace("\r\n","");str1 = str.Substring(1, 1); 

热点排行