no more windows??

This commit is contained in:
lewd-alt
2025-05-07 10:45:18 -07:00
parent eecd2a0399
commit 9d89d2cb6a
933 changed files with 408908 additions and 407973 deletions

View File

@@ -1,27 +1,28 @@
using System.IO;
using System.Text;
namespace _2DGAMELIB;
public static class Text
namespace _2DGAMELIB
{
public static void ToText(this string str, string Path, Encoding Encoding)
{
using StreamWriter streamWriter = new StreamWriter(Path, append: false, Encoding);
streamWriter.Write(str);
}
public static class Text
{
public static void ToText(this string str, string Path, Encoding Encoding)
{
using StreamWriter streamWriter = new StreamWriter(Path, append: false, Encoding);
streamWriter.Write(str);
}
public static string FromText(this string Path)
{
using FileStream fileStream = new FileStream(Path, FileMode.Open, FileAccess.Read);
byte[] array = new byte[fileStream.Length];
fileStream.Read(array, 0, array.Length);
using StreamReader streamReader = new StreamReader(new MemoryStream(array), array.GetEncoding());
return streamReader.ReadToEnd();
}
public static string FromText(this string Path)
{
using FileStream fileStream = new FileStream(Path, FileMode.Open, FileAccess.Read);
byte[] array = new byte[fileStream.Length];
fileStream.Read(array, 0, array.Length);
using StreamReader streamReader = new StreamReader(new MemoryStream(array), array.GetEncoding());
return streamReader.ReadToEnd();
}
public static string[] ReadLines(this string Path)
{
return Path.FromText().Replace("\r", "").Split('\n');
}
public static string[] ReadLines(this string Path)
{
return Path.FromText().Replace("\r", "").Split('\n');
}
}
}