Hi...now i doing split. i got face some problems.
Let say,
I got store my data in string type
1 2
1 2 3
1 2 3 4
now i want it to split line by line.But after i split them, i got the result is like this
1
2
1
2
3
1
2
3
4
this is what i don't want.
the expected output that i want are:
Output1:
1
2
output2
1
2
3
output3
1
2
3
4
and so on..
Hope somebody help me to solve this problem. thanks ya.
here is my coding.
List<KeyValuePair<String, int>> P = new List<KeyValuePair<String, int>>(itemS.ToList());
KeyitemS.Clear();
String[] SplitA;
String[] SplitB;
List<String> l = new List<String>();
foreach (KeyValuePair<String, int> pair in P)
{
KeyitemS.AppendText(pair.Key + ":" + pair.Value + "\r\n");
l.Add(pair.Key);
}
List <String> U =new List<String>();
foreach (string inter in l)
{
// MessageBox.Show(inter);
SplitA = inter.Split(' ');
SplitB = new String[SplitA.Length];
for (int i = 0; i < SplitA.Length; i++)
{
SplitB[i] = SplitA[i];
// MessageBox.Show(SplitB[i]);
U.Add(SplitB[i]);
}
}
foreach (string gg in U)
{
MessageBox.Show(gg);
}