<p>I have a string that has some Environment.Newline in it. I'd like to strip those from the string and instead, replace the Newline with something like a comma. </p>

<p>What would be, in your opinion, the best way to do this using C#.NET 2.0?</p>

[{'answer_id': 25350, 'author': 'Konrad Rudolph', 'author_id': 1968, 'author_profile': 'https://Stackoverflow.com/users/1968', 'pm_score': 0, 'selected': False, 'text': '<p>The best way is the builtin way: Use <code>string.Replace</code>. Why do you need alternatives?</p>\n'}, {'answer_id': 25351, 'author': 'Bjorn Reppen', 'author_id': 1324220, 'author_profile': 'https://Stackoverflow.com/users/1324220', 'pm_score': 2, 'selected': False, 'text': '<pre><code>string sample = "abc" + Environment.NewLine + "def";\nstring replaced = sample.Replace(Environment.NewLine, ",");\n</code></pre>\n'}, {'answer_id': 25352, 'author': 'Fredrik Kalseth', 'author_id': 1710, 'author_profile': 'https://Stackoverflow.com/users/1710', 'pm_score': 2, 'selected': False, 'text': '<p>Don\'t reinvent the wheel — just use: </p>\n\n<pre class="lang-cs prettyprint-override"><code>myString.Replace(Environment.NewLine, ",")\n</code></pre>\n'}, {'answer_id': 25353, 'author': 'Steve', 'author_id': 1857, 'author_profile': 'https://Stackoverflow.com/users/1857', 'pm_score': 3, 'selected': False, 'text': '<p>Like this:</p>\n\n<pre><code>string s = "hello\\nworld";\ns = s.Replace(Environment.NewLine, ",");\n</code></pre>\n'}, {'answer_id': 25354, 'author': 'mmattax', 'author_id': 1638, 'author_profile': 'https://Stackoverflow.com/users/1638', 'pm_score': 5, 'selected': True, 'text': '<p>Why not:</p>\n\n<pre><code>string s = "foobar\\ngork";\nstring v = s.Replace(Environment.NewLine,",");\nSystem.Console.WriteLine(v);\n</code></pre>\n'}]
['https://Stackoverflow.com/questions/25349', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2684/']