Implement RuTor

This commit is contained in:
KZ
2015-08-06 22:35:35 +01:00
parent 2b198ef688
commit d14554e45b
7 changed files with 268 additions and 6 deletions

View File

@@ -13,10 +13,15 @@ namespace Jackett.Utils
{
public static class StringUtil
{
public static string StripNonAlphaNumeric(string str)
public static string StripNonAlphaNumeric(string str, string replacement = "")
{
Regex rgx = new Regex("[^a-zA-Z0-9 -]");
str = rgx.Replace(str, "");
return StripRegex(str, "[^a-zA-Z0-9 -]", replacement);
}
public static string StripRegex(string str, string regex, string replacement = "")
{
Regex rgx = new Regex(regex);
str = rgx.Replace(str, replacement);
return str;
}