举报
C#一维string数组去掉去重算法 public static void Purge(ref List<string>needToPurge) { for(int i=0;i<needToPurge.Count-1;i++) { string deststring=needToPurge; for(int j=i+1;j<needToPurge.Count;j++) { if(deststring.CompareTo(needToPurge[j])==0) { needToPurge.RemoveAt(j); continue; } } } 比如needToPurge={"Dong Ya-Li","FAN Jiao-Jiao","YANG Ying-Juan","FAN Jiao-Jiao"}; 调用此函数后needToPurge={"Dong Ya-Li","FAN Jiao-Jiao","YANG Ying-Juan"}
本版积分规则 发表回复 回帖后跳转到最后一页
|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度
GMT+8, 2025-1-11 01:39 , Processed in 0.073972 second(s), 22 queries .
Powered by Discuz! X3.5 Licensed
© 2001-2024 Discuz! Team.