Last active
March 12, 2019 10:15
-
-
Save SamKr/d7c786490a84f0f80b249564efd80b8c to your computer and use it in GitHub Desktop.
Iterate through multiline string, checking for null
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
| if (!string.IsNullOrEmpty(multiLineString)) | |
| { | |
| using (var reader = new StringReader(multiLineString)) | |
| { | |
| string line; | |
| while ((line = reader.ReadLine()) != null) | |
| { | |
| Console.WriteLine(line); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment