[#VS2015] String Interpolation vs String.Format (your team will love you)

Hello!

I was trying to use Visual Studio 2015 as my main development IDE for a while. The new versions are more stable, so I use it more and more and I’ve not opened Visual Studio 2013 for a while.

One of the best features in VS2015 is Roslyn as main compiler for .Net. This opens a new world of possibilities for writing code in a more elegant way. One of these options is the ability to use String Interpolation instead of the classic String.Format () .

If anyone would not read the Wikipedia link or study a little, maybe it is best see the following lines of code

Note: if did not know it the ability to use String Interpolation was in the Top 10 of the most requested features to the new version of Visual Studio (link)

As the saying goes for taste colors. To my personally I like this format to work with Strings. And I believe that the recommendation of use is very clear…

Do not use String Interpolation if you are sharing code with a team where there are people who use Visual Studio 2013.

You can also find with wonders like this

Clipboard02

Saludos @ Madrid

/El Bruno

References:

Roslyn, https://github.com/dotnet/roslyn

String Interpolation, http://en.wikipedia.org/wiki/String_interpolation

String Interpolation User Voice, http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/2312991-string-interpolations-in-c

Advertisements

4 thoughts on “[#VS2015] String Interpolation vs String.Format (your team will love you)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s