考虑到这个多行字符串:
string strProviderJSON = @"
{
""npi"":""1111111111"",
""name"":""DME Clearinghouse"",
""email"":""my@doc.como"",
""contactName"":""Sally Smith"",
""fax"":"""",
""address"":{
""country"":""United States"",
""street1"":""27787 Dequindre Apt 616"",
""street2"":"""",
""city"":""Madison Heights"",
""state"":""MI"",
""zipCode"":""32003""
},
""phone"":""(904) 739-0300"",
""contactPhone"":""(904) 739-0300""
}
";
我该如何将一个变量连接进去?我尝试了这个方法,但一直出错:
string strTest = "1111111111";
string strProviderJSON = @"
{
""npi"":""" + strTest + """,
""name"":""DME Clearinghouse"",
""email"":""my@doc.como"",
""contactName"":""Sally Smith"",
""fax"":"""",
""address"":{
""country"":""United States"",
""street1"":""27787 Dequindre Apt 616"",
""street2"":"""",
""city"":""Madison Heights"",
""state"":""MI"",
""zipCode"":""32003""
},
""phone"":""(904) 739-0300"",
""contactPhone"":""(904) 739-0300""
}
";