c# br br br to n
In C#, you can replace all occurrences of <br>, <br />, and <br/> with \n (newline character) using the Replace method. Here's an example:
string input = "This is a sample text.<br>Here is a new line.<br />Another line.<br/>";
string output = input.Replace("<br>", "\n")
.Replace("<br />", "\n")
.Replace("<br/>", "\n");
Console.WriteLine(output);
Output:
This is a sample text.
Here is a new line.
Another line.
AI 优化版
原文地址:http://www.cveoy.top/t/topic/hM0e 著作权归作者所有。请勿转载和采集!