Skip to content

Instantly share code, notes, and snippets.

@kencenerelli
Last active December 16, 2015 18:29
Show Gist options
  • Select an option

  • Save kencenerelli/5478118 to your computer and use it in GitHub Desktop.

Select an option

Save kencenerelli/5478118 to your computer and use it in GitHub Desktop.
Interview Question: Reverse every word to spell them out backwards
string text = "The quick brown fox jumps over the lazy dog";
char[] characters = text.ToArray();
StringBuilder sb = new StringBuilder();
for (int i= text.Length - 1; i >= 0; i--)
{
sb.Append(characters[i]);
}
string output = sb.ToString();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment