RDR Bypass Netch Directory

This commit is contained in:
ChsBuffer
2021-02-14 22:16:42 +08:00
parent fd410ea388
commit 3771d39fb0
2 changed files with 16 additions and 3 deletions

View File

@@ -1,10 +1,11 @@
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
namespace Netch.Utils
{
static class StringEx
public static class StringEx
{
public static bool IsNullOrEmpty(this string value)
{
@@ -42,5 +43,17 @@ namespace Netch.Utils
yield return line;
}
}
public static string ToRegexString(this string value)
{
var sb = new StringBuilder();
foreach (var t in value)
{
if (new[] {'\\', '(', ')', '[', ']', '.'}.Any(s => s == t))
sb.Append(@"\");
sb.Append(t);
}
return sb.ToString();
}
}
}
}