mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2026-02-01 15:49:11 +00:00
18 lines
490 B
C#
18 lines
490 B
C#
using System.IO;
|
|
using System.Text;
|
|
|
|
namespace DiscordChatExporter.Domain.Internal
|
|
{
|
|
internal static class PathEx
|
|
{
|
|
public static StringBuilder EscapePath(StringBuilder pathBuffer)
|
|
{
|
|
foreach (var invalidChar in Path.GetInvalidFileNameChars())
|
|
pathBuffer.Replace(invalidChar, '_');
|
|
|
|
return pathBuffer;
|
|
}
|
|
|
|
public static string EscapePath(string path) => EscapePath(new StringBuilder(path)).ToString();
|
|
}
|
|
} |