-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStringThirdExample.cs
More file actions
27 lines (23 loc) · 941 Bytes
/
StringThirdExample.cs
File metadata and controls
27 lines (23 loc) · 941 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
namespace StringExamples
{
internal class StringThirdExample
{
static void Main(string[] args)
{
string first = "Rahul";
string second = "Dravid";
Console.WriteLine("Concatination using first+second: " + first + second);
Console.WriteLine();
Console.WriteLine("Concatination using string.contact(first+second): " + string.Concat(first + second));
string Third = "Sachin";
int age = 45;
string text1 = "Hello" + Third + "Your age is" + age;
Console.WriteLine(text1);
Console.WriteLine();
string text2 = string.Format("Hello {0} your age is {1}", Third, age);
Console.WriteLine("Using the String Format {0}", text2);
string text3 = $"Hello {Third} your age is {age}";
Console.WriteLine($"Using String Interpolation {text3}");
}
}
}