如何:生成多行字符串文本 (Visual Basic)

此示例构造长度为三行的字符串。

示例

Dim MyString As String
MyString = "This is the first line of my string." & VbCrLf & 
           "This is the second line of my string." & VbCrLf & 
           "This is the third line of my string."

此代码示例也可用作 IntelliSense 代码段。 在代码段选择器中,它位于**“数据类型 -- 由 Visual Basic 定义”**中。 有关更多信息,请参见如何:插入 IntelliSense 代码段

编译代码

此示例需要:

请参见

概念

将字符串转换为 .NET Framework 数据类型

创建新字符串

“字符串”示例

其他资源

字符串 (Visual Basic)

分析字符串

操作字符串

在 Visual Basic 中生成字符串