Join list of string to comma separated and enclosed in single quotes

后端 未结 6 1159
旧时难觅i
旧时难觅i 2021-02-03 19:41
List test = new List();
test.Add(\"test\'s\");
test.Add(\"test\");
test.Add(\"test\'s more\");
string s = string.Format(\"\'{0}\'\", string.J         


        
6条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-03 20:02

    This may be easier than using string.replace

    string s = "'" + String.Join("','", test) + "'";
    

提交回复
热议问题