【发布时间】:2013-06-08 17:09:33
【问题描述】:
我需要在变量中存储一个多行字符串:
dim str as string = "
some words
some words
some
words
"
怎么做?
【问题讨论】:
-
在需要换行的地方添加 Environment.NewLine
-
@Steve 谢谢,因为这是一个解决方案,但我真的想避免使用“换行符”,因为我有大量行的文本,我不能在 vbnet 中将多行字符串设置为 C# 多行字符串?
-
您不想使用 Environment.NewLine 但想要字符串中的换行符?
-
如果您的文本非常大,您可以考虑使用外部文本文件。
-
Multiline strings in VB.NET 的可能重复项