Skip to content

Commit 9b690bd

Browse files
pref: 使用 ToLowerInvariant() 而不是 ToLower()
相关文章: https://learn.microsoft.com/zh-cn/dotnet/api/system.string.tolower?view=net-9.0 https://www.cnblogs.com/TO-WW/p/6118700.html 命令参数不需要考虑地区
1 parent 4132414 commit 9b690bd

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ghv/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ static async Task Main(string[] args)
1515
string owner;
1616
string repo;
1717

18-
switch (args[0].ToLower()) // 开头的命令不区分大小写
18+
switch (args[0].ToLowerInvariant()) // 开头的命令不区分大小写
1919
// 接下来的命令参数区分大小写
2020
{
2121
case "help":

ghv/docs/ghv.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace ghv
2222
string owner;
2323
string repo;
2424

25-
switch (args[0].ToLower()) // 将命令(传给 ghv 的第1个参数)全部转为小写,使得命令不区分大小写
25+
switch (args[0].ToLowerInvariant()) // 将命令(传给 ghv 的第1个参数)全部转为小写,使得命令不区分大小写
2626
2727
// NOTE: 接下来的命令参数区分大小写
2828
{

0 commit comments

Comments
 (0)