string.Format() C#

68

string.Format() C# -

int amount = 14;
String s = String.Format("這是今年吃的第{0}顆柚子",amount);
Console.WriteLine(s);
//這裡會輸出這是今年吃的第14顆柚子

formatted string C# -

string b = "world.";

Console.WriteLine("Hello {0}", b);

Comments

Submit
0 Comments