Basic download and extract of games

This commit is contained in:
Pat Hartl 2023-01-06 22:12:03 -06:00
parent 1e63813cd6
commit ffc51f4e0d
8 changed files with 210 additions and 1 deletions

View file

@ -0,0 +1,15 @@
using System.IO;
using System.Text.RegularExpressions;
namespace LANCommander.SDK.Extensions
{
public static class StringExtensions
{
public static string SanitizeFilename(this string filename, string replacement = "")
{
var removeInvalidChars = new Regex($"[{Regex.Escape(new string(Path.GetInvalidFileNameChars()))}]", RegexOptions.Singleline | RegexOptions.Compiled | RegexOptions.CultureInvariant);
return removeInvalidChars.Replace(filename, replacement);
}
}
}