mirror of
https://github.com/netchx/netch.git
synced 2026-05-09 22:54:03 +08:00
RDR Bypass Netch Directory
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user