TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Sin Yee
NA
145
74.9k
how to convert back to array
Apr 5 2011 10:59 AM
hi...i finish my intersection now. I need to convert the output back to the array. I also need to arrange them in
the original form.
Before the intersection:
1 2
1 2 3
1 2 3 4
1 3
1 3 4
....
Now my output is like this:
2
1
2
1
3
2
1
3
4
1
3
1
3
4
i need to restore output in array and make them become like this:
my expected output that i want:
2 1
2 1 3
2 1 3 4
1 3
1 3 4
..
here is my coding:
for (int i = 0; i < myArray1.Count; i++)
{
foreach (string t in myArray1[i].ToString().Split(' '))
{
//ItemKey.AppendText(t);
hs3.Add(t);
}
var clone = new HashSet<string>(hs2);
hs2.IntersectWith(hs3);
foreach (string y in hs2)
{
ItemKey.AppendText(y);
}
hs2 = clone;
hs3.Clear();
}
What should i need to do...to make my output become like this...hope someone can help me.thanks ya...
Reply
Answers (
1
)
how to convert back to array
C# linked list