实现把String字符串转化为In后可用参数代码: public string StringToList(string aa) { string bb1 = "("; if (!string.IsNullOrEmpty(aa.Trim())) { string[] bb = aa.Split(new string[] { "\r\n", ",", ";", "* " }, StringSplitOptions
实现把String字符串转化为In后可用参数代码:
public string StringToList(string aa) { string bb1 = "("; if (!string.IsNullOrEmpty(aa.Trim())) { string[] bb = aa.Split(new string[] { "\r\n", ",", ";", "* " }, StringSplitOptions.RemoveEmptyEntries); for (int i = 0; i < bb.Length; i++) { if (!bb1.Contains(bb[i]))//去掉重复的輸入值 { bb1 += "'" + bb[i] + "',"; } } } bb1 = bb1.Substring(0, bb1.LastIndexOf(",")) + ")"; return bb1; }
技术的发展日新月异,随着时间推移,无法保证本博客所有内容的正确性,如果大家有任何疑问和补充可以联系小编。