字符串转SQL in C#
程序员文章站
2022-07-16 21:26:26
...
string[] striparr = richTextBox1.Text.Split(new string[] { "\n" }, StringSplitOptions.None);
striparr = striparr.Where(s => !string.IsNullOrEmpty(s)).ToArray();
for (int i = 0; i < striparr.Length; i++)
{
if (i == 0)
{
richTextBox2.Text = " in ('" + striparr[i].Replace(" ", "'\n,'");
}
else if (i == striparr.Length - 1)
{
richTextBox2.Text = richTextBox2.Text + striparr[i].Replace(" ", "") + "')";
}
else
{
richTextBox2.Text = richTextBox2.Text + striparr[i].Replace(" ", "") + "'\n,'";
}
}
Clipboard.SetText(richTextBox2.Text);
上一篇: kali ettercap实现dns劫持
下一篇: 【C语言及程序设计】指针运算符实验