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

textBox1.lines.Take(1)怎么转化成字符串

2012-11-10 
textBox1.lines.Take(1)如何转化成字符串textBox1.lines.Take(1)如何转化成字符串。可以这样写吗?if(textBo

textBox1.lines.Take(1)如何转化成字符串
textBox1.lines.Take(1)如何转化成字符串。
可以这样写吗?
if(textBox1.lines.Take(1)==textBox2.lines.Take(1))
{
  ……
}

[解决办法]
用First。

if(textBox1.lines.First()==textBox2.lines.First())


[解决办法]

C# code
            TextBox text = new TextBox();            text.Lines=new string[]{"1","2","3","4"};            string xstr = text.Lines.Take(1).FirstOrDefault(); 

热点排行