Hey...i am doing Split now.
But, my split method cannot function well. I want split my text file content from horizontal to vertical. But, my output always got problem.
for example
my text file content is like this..
eg.
1 2 3 4 5
2 3 4 5
my output wants like this
1 2
2 3
3 4
4 5
5
but my output always give me like this
1
2
3
4
5
2
3
4
5
So, how to solve it? And how to show it in the textbox??
StringBuilder sb = new StringBuilder();
string line;
string Temp = " ";
if (File.Exists(fileOpen.FileName))
{
StreamReader file = null;
try
{
file = new StreamReader(fileOpen.FileName);
while ((line = file.ReadLine()) != null)
{
sb.AppendLine(line);
}
// textBox1.Text = sb.ToString();
foreach (string lines in File.ReadAllLines(fileOpen.FileName))
{
string[] Split = lines.Split(new string[] { " ", "\n", "\r", "\t" }, StringSplitOptions.RemoveEmptyEntries);
foreach (string Splits in Split)
{
Temp = Temp + "\n" + Split;
}
//show line by line after split
MessageBox.Show(Temp, "read by line");
}
}
this is the coding..hope someone can help me?