关于添加后缀 [英] about adding suffixes

查看:101
本文介绍了关于添加后缀的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在做项目,因为我想在记录时检查记录是否已经存在,然后这些记录还加上后缀1,2,3,.....

i''m doing the project in that i want at the record at time check the record is already exist then these record also added with suffix like 1,2,3,.....

推荐答案

我真的不清楚您的问题.但是,例如:
如果在添加列表框之前有一个列表框,请使用:
将所有条目添加到数组中
I am really not clear about your question.But For example :
if you have a listbox before you add something in it get all entries to an array with :
ArrayList myarray=new ArrayList();
for(int i=0;i<listbox1.items.count;i++)>
{
myarray.Add(listbox1.Items[i]);
}



然后向第一个相同的条目编写一个函数.它应该旋转两次.我的意思是,您应该控制每个条目的所有条目.如果存在相同的条目,则应使用例如return来处理它;代码部分.否则,您可以添加后缀,例如:



Then write a function to f,nd same entries.It should work with two rotation.I mean you should control all of entries with every one.If there is a same entry you should handle it for example with a return; code part.Else you can add your suffix like :

int sameindex; //It should keep your index which you find the same value in others. 
listbox1.Items[sameindex]+=" +Mysuffix";


我没有尝试此代码块.但是它可以工作^^


I did not try this code block.But it will work ^^


这篇关于关于添加后缀的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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