C# Copy substring of a string then put it before the next word of the string
<p>I am trying to copy the last character of every word of a string then put the copied character to first position of the next word. For example, if I enter the string "The quick brown fox jumps over the lazy dog", the output should be "The equick kbrown nfox xjumps sover rthe elazy ydog";</p>

<p>Here is what I have so far:</p>

<pre><code>string s = "The quick brown fox jumps over the lazy dog";

for (int a = 0; a &lt; s.Length; a++)
{
    string b = s.Substring(a,1);
    if (b == " ")
    {
        string c = s.Substring(a - 1, 1);
        string d = s.Insert (a+1, c);
        Console.Write(d);                     
    }                
}
</code></pre>

<p>The result of this is this :
The equick brown fox jumps over the lazy dogThe quick kbrown fox jumps over the
lazy dogThe quick brown nfox jumps over the lazy dogThe quick brown fox xjumps o
ver the lazy dogThe quick brown fox jumps sover the lazy dogThe quick brown fox
jumps over rthe lazy dogThe quick brown fox jumps over the elazy dogThe quick br
own fox jumps over the lazy ydog</p>

<p>What I am trying to achieve is this output "The equick kbrown nfox xjumps sover rthe elazy ydog"</p>

<p>Thanks to all who answered by the way :)</p>
