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
Dylan R. E. Moonfire 78054ee2a7 feat: initial release
2021-09-07 00:15:45 -05:00

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();
}
}
}