我已经有一段时间没有接触编程了。我有一些要格式化的字符串。它们看起来像这样:
,SUM(CASE WHEN [Level] IN('4') AND Program = 1 THEN 1 ELSE 0 END) as CNT1
,SUM(CASE WHEN [Level] IN('3') AND Program = 1 THEN 1 ELSE 0 END) as CNT2
,SUM(CASE WHEN [Level] IN('2') AND Program = 1 THEN 1 ELSE 0 END) as CNT3
,SUM(CASE WHEN [Level] IN('1') AND Program = 1 THEN 1 ELSE 0 END) as CNT4
,SUM(CASE WHEN [Level] IN('0') AND Program = 1 THEN 1 ELSE 0 END) as CNT5
我想把它改成
,CNT1 = SUM(CASE WHEN [Level] IN('4') AND Program = 1 THEN 1 ELSE 0 END)
,CNT2 = SUM(CASE WHEN [Level] IN('3') AND Program = 1 THEN 1 ELSE 0 END)
,CNT3 = SUM(CASE WHEN [Level] IN('2') AND Program = 1 THEN 1 ELSE 0 END)
,CNT4 = SUM(CASE WHEN [Level] IN('1') AND Program = 1 THEN 1 ELSE 0 END)
,CNT5 = SUM(CASE WHEN [Level] IN('0') AND Program = 1 THEN 1 ELSE 0 END)
现在我有一个multiline textbox
我粘贴字符串的地方。我想单击一个按钮并将其格式化为第二个文本框。
这是我到目前为止所尝试的。但我不确定使用什么字符串函数以我想要的方式格式化它。
List<String> Items = new List<string>();
string frTxt;
foreach (string lne in txtM.Lines)
{
frTxt = "";
frTxt = lne;
}
多行文本框在哪里txtM
。如果我Console.WriteLine(lne);
在循环中这样做,它会成功循环。