$/
artifacts/
build/
docs/
lib/
packages/
samples/
src/
tests/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.IO; | |
using System.Text.RegularExpressions; | |
namespace Mojito.Core | |
{ | |
public class SanitizedFileName | |
{ | |
// https://msdn.microsoft.com/en-us/library/aa365247.aspx#naming_conventions | |
// http://stackoverflow.com/questions/146134/how-to-remove-illegal-characters-from-path-and-filenames | |
private static readonly Regex removeInvalidChars = new Regex($"[{Regex.Escape(new string(Path.GetInvalidFileNameChars()))}]", |