C# string interpolation tutorial example explained
#C# #string #interpolation
using System;
namespace MyFirstProgram
{
class Program
{
static void Main(string[] args)
{
// string interpolation = allows us to insert variables into a string literal
// precede a string literal with $
// {} are placeholders
String firstName = "Bro";
String lastName = "Code";
int age = 21;
Console.WriteLine($"Hello {firstName} {lastName}.");
Console.WriteLine($"You are {age,-10} old.");
Console.ReadKey();
}
}
}
Watch video C# string interpolation 💲 online without registration, duration hours minute second in high quality. This video was added by user Bro Code 03 July 2021, don't forget to share it with your friends and acquaintances, it has been viewed on our site 23,46 once and liked it 88 people.