Note that there are some explanatory texts on larger screens.

plurals
  1. POString Manipulation in .net 4.0
    primarykey
    data
    text
    <p>I have been out of touch with programming for a while. I have some strings I want to format. They look like this:</p> <pre><code>,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 </code></pre> <p>I want to take this and change it to </p> <pre><code>,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) </code></pre> <p>right now I have a <code>multiline textbox</code> that I paste the strings in. I want to click a button and have it formatted into a second textbox. </p> <p>This is what I've tried so far. but I am not sure what string functions to use format it the way i want. </p> <pre><code> List&lt;String&gt; Items = new List&lt;string&gt;(); string frTxt; foreach (string lne in txtM.Lines) { frTxt = ""; frTxt = lne; } </code></pre> <p>where <code>txtM</code> is the multiline textbox. If I do <code>Console.WriteLine(lne);</code> in the loop, it loops through successfully.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload