mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Replaced regex with a while loop
This commit is contained in:
@@ -358,7 +358,12 @@ namespace Orchard.ContentTypes.Services {
|
||||
}
|
||||
|
||||
private static string VersionName(string name) {
|
||||
var substring = Regex.Match(name, @"\d+$").Value;
|
||||
var i = name.Length - 1;
|
||||
while (i >= 0 && char.IsDigit(name, i)) {
|
||||
i--;
|
||||
}
|
||||
|
||||
var substring = i != name.Length - 1 ? name.Substring(i + 1) : string.Empty;
|
||||
int version;
|
||||
|
||||
if (int.TryParse(substring, out version)) {
|
||||
|
||||
Reference in New Issue
Block a user