Today we are going to explore yet another new feature of C# 6.0 which will be coming in this release. This is my fourth post in the series of C# 6.0 New Features. Don't forget to read my previous post in this Series :
Today we will be learning about String Interpolation/String Concatenation with respect to C# 6.0.
String Concatenation - It's used to join the different records to the users and to accomplish this we either use "+" symbol or string.Format method to format and to organize it. With the new release of C# 6.0, it's now a old mechanism.
But now with C# 6.0, Developer can directly put expressions in the string literal to show the values in proper format and you can even align or specify different format to your values. And one of the best is, Developer can write conditions within string literals with additional strings as content.
Below are the few examples :
Hope you like this feature and since Microsoft is yet to release the stable version of Visual Studio 2015 and C# 6.0, so you can expect quite a lot more feature in String Interpolation. Stay tune to my series of post on C# 6.0 Features. Happy Coding.