In C# 6 you can use string interpolation:
string name = "John";
string result = $"Hello {name}";
The syntax highlighting for this in Visual Studio makes it highly readable and all of the tokens are checked.
More Related Contents:
- How can I format a number into a string with leading zeros?
- Add separator to string at every N characters?
- Format a string into columns
- String.Format – how it works and how to implement custom formatstrings
- Is there a “String.Format” that can accept named input parameters instead of index placeholders? [duplicate]
- Display Float as String with at Least 1 Decimal Place
- De-serializing json format string
- Split and cut string in C# [closed]
- How to cut up a string from an input file with Regex or String Split, C#?
- How to add a char every X specific char in C# [closed]
- Using C# to check if string contains a string in string array
- How do I read a specified line in a text file?
- Best way to repeat a character in C#
- How to check if a String contains any of some strings
- Why use String.Format? [duplicate]
- Get Substring – everything before certain char
- string.Format() giving “Input string is not in correct format”
- Difference between == operator and Equals() method in C#?
- Replacing escape characters from JSON
- Split string into string array of single characters
- DateTime conversion from string C#
- C#: how to get first char of a string?
- Why doesn’t VS 2008 display extension methods in Intellisense for String class
- Search for a string in Enum and return the Enum
- Extract only right most n letters from a string
- How can CString be passed to format string %s?
- Get text between 2 html tags c#
- How can I safely convert a byte array into a string and back? [duplicate]
- Does any one know of a faster method to do String.Split()?
- How do i replace accents (german) in .NET