我想给一个字符串许多字符串比较。如何在C#中做呢?
I want to compare one string with many strings. How is that done in C#?
如果你想检查一个字符串包含在一个字符串列表,你可以使用的 包含
扩展方法:
If you want to check if a string is contained in a list of strings you could use the Contains
extension method:
bool isStringContainedInList =
new[] { "string1", "string2", "string3" }.Contains("some string")
下一篇:通过计算除了指数只指数