IEnumerable<string> to string

Viewed 28818

Consider this:

string test = "";
somestring.ToList().Take(50).Select(
    delegate(char x)
    {
        test += x;
        return x;
    }
);

Why is test empty after that? I don't care about the return of that actually (I know its IEnumerable<string>).

If this is all seems a mess then how can I convert the IEnumerable<char> returned by Select() to string ?

5 Answers
Related