Created
November 23, 2016 08:25
-
-
Save M-Yankov/842959099318476781721aec5c4157fd to your computer and use it in GitHub Desktop.
Sample async example.
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
private async Task<string> Execute() | |
{ | |
// Keep watching for out of memory exception when using new string | |
string text = "First Line" + Environment.NewLine + "Second" + Environment.NewLine + new string('-', int.MaxValue / 33); | |
text += text; | |
StringReader reader = new StringReader(text); | |
Console.WriteLine("=Before="); | |
string readText = await reader.ReadLineAsync(); | |
Console.WriteLine("=After="); | |
Console.WriteLine(readText); | |
return readText; | |
/* Result | |
* =Before= | |
* =After= | |
* First Line | |
*/ | |
} |
Author
M-Yankov
commented
Jul 17, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment