Can't this be done with a simple for
loop followed by a single if
statement?
for(int i=0;i<characters.Length-1;i+=2)
{
output.Append(characters[i+1]);
output.Append(characters[i]);
}
if (characters.Length % 2 == 1) output.Append(characters[characters.Length - 1]);
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.