在 Windows 窗体中,所有回车符都保留在多行文本框中,因此问题可能在于从数据库检索数据的方式。 我从未使用过 PostGres,但我猜测您从数据库检索文本的方式是将所有空格替换为单个空格。
In Windows forms all carriage returns are preserved in a multiline text box, so the problem likely lies in the way data is retrieved from your database. I've never used PostGres, but I'm guessing that the way you're retrieving the text from the db is replacing all whitespace with single spaces.
发布评论
评论(2)
如果我没记错的话,文本框实际上是一个字符串数组。
我认为你可以这样做:
再次编辑:如果你想保留空行,请更改为 StringSplitOptions.None
If I recall correctly, the textbox is really a string array.
I think you can do this:
Edit again: If you want to keep the blank lines, the change to StringSplitOptions.None
在 Windows 窗体中,所有回车符都保留在多行文本框中,因此问题可能在于从数据库检索数据的方式。 我从未使用过 PostGres,但我猜测您从数据库检索文本的方式是将所有空格替换为单个空格。
In Windows forms all carriage returns are preserved in a multiline text box, so the problem likely lies in the way data is retrieved from your database. I've never used PostGres, but I'm guessing that the way you're retrieving the text from the db is replacing all whitespace with single spaces.