Join Reynald Adolphe for an in-depth discussion in this video Manipulating strings using string interpolation, part of C# 6.0 First Look.
- String interpolation allows you to manipulate strings…in a more concise manner than string format,…which tended to be error prone,…especially when having to keep track…of the order of several placeholders.…In our example here,…on line 53,…you'll notice that we have three different placeholders,…which isn't a big deal, but what if it was about seven…or ten or even more placeholders?…Then it becomes a little bit tricky…in order to keep track of them.…
Let's go ahead and run this and see what the output is.…And as we would expect, it writes out the address…that we defined.…Let's go ahead and rework this…in order to implement the new string interpolation feature.…The first thing we'll do…is start off defining our variable,…equals, and start off with a dollar sign…to indicate that a string is to follow.…Then we can go ahead…and ...…
write in our address.…The key difference is that instead of these placeholders,…we can go ahead and put in the variable names…that we care about, such as city,…state,…and zip code.…Finish off with a semicolon.…
- Introducing the new IDE in Visual Studio 2015
- Leveraging nameof expressions
- Using index initializers
- Using await in catch and finally blocks
- Using static
- Resolving conflict instance methods
Skill Level Beginner
1. Touring the Enhanced IDE
2. Expression-Level Features
3. Statement-Level Features
Adding exception filters2m 42s
4. Member Declaration and Initialization Features
5. Improved Debugging
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.