Ad space (banner)
๐Ÿ”ทVB.NET Lessons
Lesson 46 / 68

Multi-line text (building it with vbCrLf)

This lesson covers building multi-line text with VB.NET's vbCrLf, with the aim of producing readable messages.

vbCrLf is the special string representing a line break; combining it with & assembles a message spanning several lines. Use it when one variable has to hold multi-line text.

The sample code joins a greeting, a thank-you, and a closing line with vbCrLf between them via &, gathers them into a single message variable, and prints it with Console.WriteLine().

A common early stumble is how to break a long line of code across several. Putting the & at the end of a line and continuing on the next, as the sample does, keeps a long concatenation legible.

In professional work, this comes up whenever multi-line text has to be assembled — email bodies, log messages, notifications.

๐Ÿ“– Reference code
โœ๏ธ Your code
Type your code, then press "Run"

๐Ÿงช This site can't compile or run VB.NET directly, so it checks on the spot whether what you typed matches the reference code (scoring happens entirely in your browser โ€” nothing is sent anywhere).

Ad space (banner)
Ad space (in-article)