This repository has been archived on 2023-02-02. You can view files and clone it, but cannot push or open issues or pull requests.
mfgames-nitride-cil/src/Nitride/Contents/TextContentExtensions.cs

23 lines
524 B
C#
Raw Normal View History

2021-09-07 05:15:45 +00:00
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();
}
}
}