New Visual Basic 9 string features

Thats something really good! Now in the new Visual Studio 2008 you don’t have to use underscore when writing text on multiple lines. Here is an example how we used to write it:

Now we can do something like that:

The text formatting is preserved as well. All you have to do is get the .Value of the XElement, which is the string literal. As you can see this is much cleaner than what we’re used to. And if you still like to see your string literals in the default reddish color, you can easily change the color settings for VB XML literals in Tools –> Options –> Environment –> Fonts and Colors, then select “VB XML Text” and set the custom color to RGB(163,21,21).

Even more, now we can embed expressions using the <%= syntax.

Here is Beth Massi’s post about these features! Thanks Beth!

Leave a Reply

Your email address will not be published. Required fields are marked *