如何在C#中将char与列表进行比较 [英] how to compare char with list in c#

查看:375
本文介绍了如何在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?


这篇关于如何在C#中将char与列表进行比较的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆