Created
June 29, 2016 13:44
-
-
Save nathanchere/ee879dc403f280f5737a4c27eeb6b1d4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
public static Stream AsStream(this string input) | |
{ | |
var result = new MemoryStream(); | |
using (var writer = new StreamWriter(result)) { | |
writer.Write(input); | |
} | |
result.Position = 0; | |
return result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment