23 lines
524 B
C#
23 lines
524 B
C#
using System.IO;
|
|
|
|
namespace Nitride.Contents
|
|
{
|
|
public static class TextContentExtensions
|
|
{
|
|
public static string GetText(this ITextContent content)
|
|
{
|
|
var writer = new StringWriter();
|
|
using TextReader reader = content.GetReader();
|
|
string? line = reader.ReadLine();
|
|
|
|
while (line != null)
|
|
{
|
|
writer.WriteLine(line);
|
|
line = reader.ReadLine();
|
|
}
|
|
|
|
return writer.ToString();
|
|
}
|
|
}
|
|
}
|