由网友(放纵不羁笑点低)分享简介:什么是一个字符串,在字符串数组比较的最快方法C#2.0 What is the fastest way to compare a string with an array of strings in C#2.0推荐答案您的意思是,看看该字符串数组中?我不记得,如果阵列支持。载()方法,因此,如果没有,创建一个列表...
什么是一个字符串,在字符串数组比较的最快方法C#2.0
What is the fastest way to compare a string with an array of strings in C#2.0
推荐答案
您的意思是,看看该字符串数组中?我不记得,如果阵列支持。载()方法,因此,如果没有,创建一个列表<字符串>,通过您的AddRange阵列添加到列表中(),然后调用list.Contains({字符串比较})。会返回一个布尔值,表示字符串是否到数组中。
You mean to see if the string is in the array? I can't remember if arrays support the .Contains() method, so if not, create a List< string >, add your array to the list via AddRange(), then call list.Contains({string to compare}). Will return a boolean value indicating whether or not the string is in the array.
相关推荐
最新文章