🪼 perf(工具): 优化字符串分割语法,使用更简洁的Split方法调用
This commit is contained in:
parent
ed49e27251
commit
d43efc424a
@ -52,7 +52,7 @@ public static class CommonHelper
|
||||
string noLetters = Regex.Replace(version, "[a-zA-Z]", "");
|
||||
|
||||
// 2. 按 '.' 分割版本号
|
||||
string[] parts = noLetters.Split(['.'], StringSplitOptions.RemoveEmptyEntries);
|
||||
string[] parts = noLetters.Split('.', StringSplitOptions.RemoveEmptyEntries);
|
||||
|
||||
// 3. 确保至少有3部分,不足则补 "0"
|
||||
if (parts.Length < 3)
|
||||
|
||||
@ -31,7 +31,7 @@ public class PathTreeBuilder
|
||||
|
||||
foreach (var path in paths)
|
||||
{
|
||||
var parts = path.Split(['/'], StringSplitOptions.RemoveEmptyEntries);
|
||||
var parts = path.Split('/', StringSplitOptions.RemoveEmptyEntries);
|
||||
TreeNode currentNode = root;
|
||||
|
||||
foreach (var part in parts)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user