Skip to content

Instantly share code, notes, and snippets.

Do You Have a Case of var Guilt
public string reverse(string toReverse)
{
var reversed = "";
var lastCharacterIndex = toReverse.Length -1;
var firstCharacterIndex = 0;
for(var index = lastCharacterIndex; index >= firstCharacterIndex; index--)
{
var letter = toReverse[index];
reversed += letter;
}
return reversed;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment