19
1
using System;
2
3
public class StringProgram
4
{
5
public static void Main()
6
{
7
double currency = 10.5;
8
string strFormat;
9
strFormat = string.Format("Your balance is {0:C}", currency);
10
11
Console.WriteLine(strFormat);
12
13
14
string str = "Name:{0} {1}, Location:{2}, Age:{3}";
15
16
string msg = string.Format(str, "Jaya", "Dasari", "Delhi", 32);
17
Console.WriteLine("Format Result: {0}", msg);
18
}
19
}
Cached Result