-
Notifications
You must be signed in to change notification settings - Fork 1
Strings
Mario Gutierrez edited this page Jan 7, 2017
·
2 revisions
string.Format("{0} {1} {2}", a, b, c);
With format specification.
string.Format("{0:d9}", someNumber);
With "verbatim" strings, no escaping is done (\n, \t, etc).
string v = @"This is a ""verbatim"" string. Backslashes, \, are not escaped.";
.NET 4.6+
With "interpolated" strings, variables can be referenced in the string and filtered.
string p = $"myVariable has value {myVariable | expression}."
- Abstract Classes
- Access Modifiers
- Anonymous Methods
- Anonymous Types
- Arrays
- Attributes
- Console I/O
- Constructors
- Const Fields
- Delegates
- Enums
- Exceptions
- Extension Methods
- File IO
- Generics
- Interfaces
- Iterators
- LINQ
- Main
- Null Operators
- Parameters
- Polymorphism
- Virtual Functions
- Reflection
- Serialization
- Strings
- Value Types
- "Base" Keyword
- "Is" and "As"
- "Sealed" Keyword
- nameof expression