字符串格式化

以前常用的是:string.format("{0}{1}, a, b)这样格式。

实际上还有一种格式更好一点:

string id = "10";

int m = 20
string str = $"linezero-{id}, {m}";

字符串需要前导字符$

原文地址:https://www.cnblogs.com/81/p/8513760.html