using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Test60
{
class Program
{
static void Main(string[] args)
{
string ss = "123";
string str = $"{ss}";
string str1 = string.Format("{0}", 123);
SSS sss = new SSS();
var str2 = string.Format("this is test {0},{1}", sss.aa, sss.bb);
Console.WriteLine(str2);
var str3 = $"this is test {sss.aa} ,{sss.bb}";
Console.WriteLine(str3);
//str3 = "this is test \{sss.aa},\{sss.bb}";只能在预览版本中使用,正式版使用$
Console.WriteLine(str3);
Console.Read();
}
public class SSS
{
public int aa { get; set; } = 1;
public string bb { get; set; } = "123";
}
}
}