I have the following code. bit it gives me error that The best overload
method for string.Split(pa rams char[]) has some invalid arguments. I am
using stringbuilder which doesn't have split method so how can I do that.
public static string[] ReadFileLines(s tring path)
{
int read = 0;
StringBuilder builder = new StringBuilder() ;
byte[] buffer = new byte[1024];
using (FileStream readStream = File.Open(path, FileMode.Open,
FileAccess.Read , FileShare.Read) )
{
while ((read = readStream.Read (buffer, 0, buffer.Length)) 0)
builder.Append( Encoding.UTF8.G etString(buffer , 0, read));
}
return String.Split(bu ilder.ToString( ), "\r\n");
}
method for string.Split(pa rams char[]) has some invalid arguments. I am
using stringbuilder which doesn't have split method so how can I do that.
public static string[] ReadFileLines(s tring path)
{
int read = 0;
StringBuilder builder = new StringBuilder() ;
byte[] buffer = new byte[1024];
using (FileStream readStream = File.Open(path, FileMode.Open,
FileAccess.Read , FileShare.Read) )
{
while ((read = readStream.Read (buffer, 0, buffer.Length)) 0)
builder.Append( Encoding.UTF8.G etString(buffer , 0, read));
}
return String.Split(bu ilder.ToString( ), "\r\n");
}
Comment