I would like to remove all newlines without using for loop and then the array might changed the order. The code must go at the commented line of code below.
string[] filterInput1 = tbInput1.Text.Split(new string[] { Environment.NewLine }, StringSplitOptions.None);
//(remove all Environment.NewLine or "" code goes here).
string after_resultInput1 = "";
for (int i = 0; i < filterInput1.Length; i++)
{
string[] getDict = filterInput1[i].Split(new char[] { Convert.ToChar(tbDelim.Text) });
after_resultInput1 += getDict[Convert.ToInt32(tbColumn.Text)] + Environment.NewLine;
}
The array of filterInput1 after Split()
filterInput1
{string[6]}
[0]: "asdasdasd|abc"
[1]: ""
[2]: ""
[3]: "1111"
[4]: ""
[5]: ""
The result must be:
filterInput1
{string[2]}
[0]: "asdasdasd|abc"
[1]: "1111"