如何在C#中将char与列表进行比较

问题描述:

我想将char数组中的字符与另一个char数组或ex列表进行比较.
a1a是一个数组中的一个项目,而a1bc是另一个char数组中的另一个元素,或者与a1ab或a3b与a3cb进行比较,它应该返回true&比较后返回true或false

Hi I want to compare characters in char array with another char array or list for ex.
a1a is an item in one array & a1bc is another element in another char array or aa1 compare with a1ab or a3b with a3cb it should return true & after comparing return true or false

您的问题尚不清楚.您想将char数组或列表与另一个char数组或列表进行比较,对吗?您没有明确定义的比较标准是什么?您要查找完全匹配,部分匹配,任何字符,任何x个字符的匹配吗?

您的例子根本不清楚.您说将a1ab a3b a3cb 进行比较,它应该返回true.在第一种情况下,a1ab & a3cb匹配a, a*b ,而a3b & a3cb匹配a3, a*b

那么您的匹配条件是什么?
Your question is not clear. You want to compare char array or list with another char array or list, right? What you did not clearly define is what is your compare criteria? Are you looking for exact match, partial match, any character, any x charcters match?

You example is not clear at all. you said compare a1ab or a3b with a3cb it should return true. Well in the first case a1ab & a3cb matchs a, a*b where as a3b & a3cb matches a3, a*b

so what is your matching criteria?