| Start |
|---|
Format dates in strings You can also use the Output: It's November 11, 2015, make a wish! Live Demo on .NET Fiddle (opens new window) Live Demo using DateTime.ToString (opens new window) Note: |
| Padding the output String can be formatted to accept a padding parameter that will specify how many character positions the inserted string will use : **NOTE:** Positive padding values indicate left padding and negative padding values indicate right padding. Left PaddingA left padding of 5 (adds 3 spaces before the value of number, so it takes up a total of 5 character positions in the resulting string.) Output: Live Demo on .NET Fiddle (opens new window) Right PaddingRight padding, which uses a negative padding value, will add spaces to the end of the current value. Output: Live Demo on .NET Fiddle (opens new window) Padding with Format SpecifiersYou can also use existing formatting specifiers in conjunction with padding. |
| Expressions Full expressions can also be used in interpolated strings. |
Simple Usage Behind the scenesInternally this Will be compiled to something like this: |
| Formatting numbers in strings You can use a colon and the standard numeric format syntax (opens new window) to control how numbers are formatted. Live Demo on .NET Fiddle (opens new window) Syntax
RemarksString interpolation is a shorthand for the |
Read Article
https://develop.horje.com/learn/1434/reference