Skip to content

Commit d64b4b5

Browse files
committed
Change the way getting acronym
1 parent aaa9381 commit d64b4b5

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

Flow.Launcher.Infrastructure/PinyinAlphabet.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,11 @@ public string Translate(string content)
4747
chineseIndexs.Add(i);
4848
}
4949
StringBuilder resultBuilder = new StringBuilder();
50-
resultBuilder.Append(string.Concat(resultList.Where((r, i) => chineseIndexs.Contains(i)).Select(s => s.First())));
50+
51+
foreach (var chineseIndex in chineseIndexs)
52+
{
53+
resultBuilder.Append(resultList[chineseIndex].First());
54+
}
5155
resultBuilder.Append(' ');
5256

5357
int currentChineseIndex = 0;
@@ -90,10 +94,5 @@ public string Translate(string content)
9094
return content;
9195
}
9296
}
93-
94-
private string GetFirstPinyinChar(string content)
95-
{
96-
return string.Concat(content.Split(' ').Select(x => x.First()));
97-
}
9897
}
9998
}

0 commit comments

Comments
 (0)