Skip to content

Instantly share code, notes, and snippets.

@itsbth
Created December 2, 2011 22:53
Show Gist options
  • Select an option

  • Save itsbth/1425217 to your computer and use it in GitHub Desktop.

Select an option

Save itsbth/1425217 to your computer and use it in GitHub Desktop.
using System;
unsafe class Unsafe
{
public static unsafe string DoStuff()
{
string st = "-0.5";
fixed (char *str = st)
return new String(str + 1);
}
public static string DoStuff2()
{
return "-0.5" + 1;
}
public static void Main()
{
Console.WriteLine(DoStuff());
Console.WriteLine(DoStuff2());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment