\n *is* the end of a line and is working correctly.
How can you want some of your ends of lines not to be ends of lines?
But if what you mean is that you want to preserve the strings, I suppose you
could convert every end of line mark to something else before writing the
string out, and undo the conversion after reading it in again.
[quoted text, click to view] "jeff" <jeff@discussions.microsoft.com> wrote in message
news:17ECDAC6-4524-4879-8254-0818E76B77F0@microsoft.com...
> hi, all.
>
> Here is a stupid question.
>
> I have three string
> string str1 =" test1 ";
> string str2 =" test21\ntest22\ntest23"; (\n means return key)
> string str3 =" test3 ";
> I write them to a file(test.txt) by using Stream.write();
> I open the file:
> it is:
> test1
> test21
> test22
> test23
> test3
> when I read test.txtby using Stream.read(), I can not restore it again.I
> got
> 5 string.
> indeed, It should three string?
>
> What should I do?
>
> Thanks
>
>
>
>
>
>
>