Skip to content

Instantly share code, notes, and snippets.

@davidfowl
davidfowl / dotnetlayout.md
Last active November 13, 2024 13:19
.NET project structure
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/
@sergiorykov
sergiorykov / SanitizedFileName.cs
Created September 1, 2016 14:57
Sanitized File Name C#
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()))}]",