C#在一个数组里找到相同的字符串
C#在一个spring数组里找出相同的字符串,比如ArrayListmylist1=newArrayList(){"1b","1b","2t","3t","4t","5t...
C#在一个spring数组里找出相同的字符串,比如
ArrayList mylist1 = new ArrayList(){"1b","1b","2t","3t","4t","5t","5t","6w","6w"};
找出后放到一个数组里,让数组得到ArrayList mylist2 = new ArrayList(){"1b","1b","5t","5t","6w","6w"}; 展开
ArrayList mylist1 = new ArrayList(){"1b","1b","2t","3t","4t","5t","5t","6w","6w"};
找出后放到一个数组里,让数组得到ArrayList mylist2 = new ArrayList(){"1b","1b","5t","5t","6w","6w"}; 展开
2个回答
展开全部
X 表示以十六进制形式输出
02 表示不足两位,前面补0输出;出过两位,不影响
举例:
printf("%02X", 0x123); //打印出:123
printf("%02X", 0x1); //打印出:01
02 表示不足两位,前面补0输出;出过两位,不影响
举例:
printf("%02X", 0x123); //打印出:123
printf("%02X", 0x1); //打印出:01
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
public void test()
{
ArrayList mylist1 = new ArrayList();
mylist1.Add("1b");
mylist1.Add("1b");
mylist1.Add("2t");
mylist1.Add("3t");
mylist1.Add("4t");
mylist1.Add("5t");
mylist1.Add("5t");
mylist1.Add("6w");
mylist1.Add("6w");
ArrayList temp = new ArrayList();
foreach(string s in mylist1)
{
int count = 0;
foreach(string v in mylist1)
{
if(v.Equals(s))
count = count + 1;
}
if(count > 1)
{
temp.Add(s);
}
}
foreach(string s in temp)
{
Report.Info(s + " ");
}
}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询