Created
January 17, 2017 03:15
-
-
Save ScottKaye/dd16e23c6ab9c54195e33ace5f51fd70 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Main() | |
{ | |
string input = Console.ReadLine(); | |
input.EatHorror("abcdefg"); | |
input.Dump("Eaten"); | |
(input + " - Appended").Dump("Fix?"); | |
"hello".Dump("Try entering \"hello\""); | |
} | |
public static class Ext | |
{ | |
// Unspeakable things | |
public static unsafe void EatHorror(this string s, string r) | |
{ | |
fixed (char* c = string.Intern(s)) for (int i = 0; i < Math.Min(s.Length, r.Length); c[i] = r[i++]) ; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example where input was
hello
.