Improve valid cd-key checks, closes #69

This commit is contained in:
JustArchi
2016-01-10 22:25:15 +01:00
parent 8d06dd90d8
commit 35fb7c4e7f
2 changed files with 19 additions and 11 deletions

View File

@@ -57,5 +57,20 @@ namespace ArchiSteamFarm {
return Regex.Replace(text, @"[^\d]", "");
}
internal static uint GetCharCountInString(string s, char c) {
if (string.IsNullOrEmpty(s)) {
return 0;
}
uint count = 0;
foreach (char singleChar in s) {
if (singleChar == c) {
count++;
}
}
return count;
}
}
}