private void button1_Click(object sender, EventArgs e) { string txt = this.richTextBox1.Text; txt = txt.Replace("\n", ",").Replace(" ", "!"). Replac..... ...
private void button1_Click(object sender, EventArgs e) { string txt = this.richTextBox1.Text; txt = txt.Replace("\n", ","). Replace(" ", "!"). Replace(" ", "!"). Replace(" ", "!"). Replace(" ", "!"). Replace(" ", "!"). Replace(" ", "!"). Replace(" ", "!"). Replace(" ", "!"). Replace(",", "],MAX(CASE WHEN s.Col_name_en ='"). Replace("!", "' THEN s.Actual ELSE null END) as "). Replace("as", "as [").Replace("[ ", "[").Replace(" [_","_").Replace("_as [' ", "_as' "); this.richTextBox2.Text = "MAX(CASE WHEN s.Col_name_en ='" + txt; }
2019-3-28 更新 截取字元。
/// <summary> ///基於getsql方法 封裝的獲取列方法。 /// </summary> /// <param name="MessageSql"></param> /// <returns></returns> private string GetColByMessage(string MessageSql) { string[] a = MessageSql.Split(','); string relstr = ""; foreach (var item in a) { relstr += item.Substring(item.IndexOf("as ") + 2).Trim() + ","; } return relstr.Substring(0, relstr.Length - 1); }