简单的代码如下:
public static string[] GetProductList(string inputstring)
{
char[] split = { ',', ' ', ';', ';', ',', ':', ':', (char)10, (char)13 };
return inputstring.Split(split, StringSplitOptions.RemoveEmptyEntries);
}
获取sql in 部分的代码:
public static string GetSQLInPartByProductlist(string[] productlist)
{
string inpartsql = " in (";
string endpart = ")";
foreach (string item in productlist)
{
inpartsql += "'" + item + "'," + " ";
}
inpartsql = inpartsql.Remove(inpartsql.Length - 2);
inpartsql += endpart;
return inpartsql;
}
测试的界面