当前位置:编程学习 > C#/ASP.NET >>

你信吗?

怎么判断execl中除了有数据的行数,去除空行? --------------------编程问答-------------------- readline=‘’ --------------------编程问答--------------------
引用 1 楼 stubble 的回复:
readline=‘’

这是一个属性? --------------------编程问答-------------------- 用流去读文件 读到的行为空 就可以了吧 --------------------编程问答-------------------- 可以给一个简单的DOME吗? --------------------编程问答--------------------

string filePath = @"c:temptest.txt";
            string line; 
 
            if (File.Exists( filePath ))
            {
                StreamReader file = null;
                try
                {
                    file = new StreamReader( filePath );
                    while ((line = file.ReadLine()) != null)
                    {
                        Console.WriteLine( line );
                    }
                }
                finally
                {
                    if (file != null)
                        file.Close();
                }
            } 
 
            Console.ReadLine();

--------------------编程问答-------------------- trim()        --------------------编程问答-------------------- 除 --------------------编程问答--------------------
引用 6 楼 chinaheart88 的回复:
trim()       

不是一个字符串,而是一个execl中的某一列 --------------------编程问答--------------------
引用 5 楼 zxy397472251 的回复:

string filePath = @"c:temptest.txt";
            string line; 
 
            if (File.Exists( filePath ))
            {
                StreamReader file = null;
                try
                {
                    file = new StreamReader( filePath );
                    while ((line = file.ReadLine()) != null)
                    {
                        Console.WriteLine( line );
                    }
                }
                finally
                {
                    if (file != null)
                        file.Close();
                }
            } 
 
            Console.ReadLine();


我试一下,看可以不,先谢谢你的代码
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,