我想在c#字符串中添加雙引號。C#字符串中的雙引號
string searchString = "123";
string inputString = "No matches found for "+ "\""+searchString + "\"";
輸出:No matches found for "123"
我想在c#字符串中添加雙引號。C#字符串中的雙引號
string searchString = "123";
string inputString = "No matches found for "+ "\""+searchString + "\"";
輸出:No matches found for "123"
你有什麼要出示你的期望是什麼:
No matches found for "123"
您也可以嘗試:
string searchString = "123";
string inputString = String.Format(@"No matches found for ""{0}""!", searchString);
我認爲你需要string.format
。
例如:
string.format("No matches found for \"{0}\"", searchString);
string inputString = String.Format(@"No matches found for \"{0}\"", searchString);
,什麼是你的問題? – LukeH 2010-08-31 12:03:09
這裏有問題嗎? – codaddict 2010-08-31 12:03:19
那你有什麼問題? – KeatsPeeks 2010-08-31 12:03:26