字符串小问题
前台有字符串 '1,2,3,4,5..... ',传到数据库怎么让他变成
'1 ', '2 ', '3 ', '4 ', '5 '....
------解决方案--------------------REPLACE( ", ", " ', ' ")
------解决方案--------------------string str = " '1,2,3,4,5 ' ";
str = str.Replace( ", ", " ', ' ");
Console.WriteLine(str);
------解决方案--------------------用正则替换数字吧
------解决方案--------------------str = " '1,2,3,4,5 ' ".Replace( ", ", " ', ' ");
------解决方案--------------------学习
------解决方案--------------------REPLACE( ", ", " ', ' ")
------解决方案--------------------现在高手 都来抢分了
------解决方案--------------------string a= '1,2,3,4,5..... ';
a.Replace( ", ", " ', ' ");
------解决方案--------------------string str = " '1,2,3,4,5 ' ";
str = str.Replace( ", ", "\ ',\ ' ");
Response.Write(str);
------解决方案--------------------学习中....
------解决方案--------------------string str = " '1,2,3,4,5 ' ";
str = str.Replace( ", ", "\\ ',\\ ' ");
Response.Write(str);
------解决方案--------------------經過測試沒有問題
string a= " '1,2,3,4 ' ";
string b=a.Replace( ", ", " ', ' ");