Skip to content

Instantly share code, notes, and snippets.

@dazfuller
Created October 11, 2013 20:12
Show Gist options
  • Select an option

  • Save dazfuller/6941266 to your computer and use it in GitHub Desktop.

Select an option

Save dazfuller/6941266 to your computer and use it in GitHub Desktop.
Reversing a string by creating an extension method on a character array
void Main()
{
var newString = "Ignoring the Voices".Reverse().ToArray().AsString();
newString.Dump();
}
// Define other methods and classes here
public static class EnumerableExtensions
{
public static string AsString(this char[] array)
{
return new string(array);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment