question

BitSmithy-4663 avatar image
0 Votes"
BitSmithy-4663 asked RichardZhang-MSFT answered

How to read from TextBox LineByLine

I have a TextBox with AcceptsReturn="True"


Now I want to read from it line by line
I tried code:

         string[] modelLines;
         modelLines = ModelTextBox.Text.Split('\n');

But it doesnt work, how to read from TextBox line by line?

windows-uwp
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

RichardZhang-MSFT avatar image
0 Votes"
RichardZhang-MSFT answered

Hello,​

Welcome to our Microsoft Q&A platform!

In TextBox, the default line separator is \r, so try this:

 var modelLines = ModelTextBox.Text.Split('\r');

Thanks.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.