我在Visual Studio中用C#编程,我会用SerialPort发送以下字符串:
AT+CWJAP = "text1" , "text"
我的代码是:
string a = "AT+CWJAP=";
string b = "\"text1\"";
string c = "\"text\"";
string y = "a + b + "," + c";v
但结果是:y = "AT+CWJAP=\"text1\",\"text\""
我不想发送反斜杠(\)
。
答案 0 :(得分:0)
我想你想要这样的东西:
string a = "AT+CWJAP=";
string b = "\"text1\"";
string c = "\"text\"";
string y = string.Format("{0}{1},{2}", a, b, c);
Y的值为:AT + CWJAP =" text1"," text"