C# 字串相加

  • 126
  • 0
  • 2021-01-25

C# 字串相加

字串相加的方法

1.相加

string a = "a";
string b = "Q1";

Console.WriteLine(a+b);

輸出結果:aQ1

2.

string a = "a";
string b = "Qb";

Console.WriteLine($"{a}{b}");

輸出結果:aQb

參考資料:https://docs.microsoft.com/zh-tw/dotnet/csharp/language-reference/tokens/interpolated