0
//Rextester.Program.Main is the entry point for your code. Don't change it.
//Compiler version 4.0.30319.17929 for Microsoft (R) .NET Framework 4.5
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
namespace Rextester
{
public class Program
{
public static void Main(string[] args)
{
var type = "Fighter"
var VType = $"{type}_(192.168.1.90)";
//Your code goes here
Console.WriteLine(VType);
}
}
}
我想在C#中使用online C# compiler的字符串插值。它給了我一個錯誤,Unexpected character '$'
。在C中的字符串插值#
我在做什麼錯?
很可能你使用的是舊版本的c#/ VS –
嗯,它說*不要改變*。你改變了它。在線編譯器不值得你花時間,你可以在你的機器上得到一個理解這種語法的程序。 –