int age=18;
Console.WriteLine($"XiaoMing is \"{age}\" {{ years}} old");
Console.WriteLine($@"XiaoMing is \""{age}\""
{{ years}} old");
 
c# $和@ 简化字符串格式化拼接
Console.Write( $"{DateTime.Now:yyyy-MM-dd}"); //支持表达式
 
c# $和@ 简化字符串格式化拼接

 

 


 

相关文章: