如何删除重复值。 [英] How to remove the duplicates value.
本文介绍了如何删除重复值。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嘿,在地址栏中有重复值
例如Alak Jyot chs flat no 1101 Alak Jyot chs flat no 1101
- 在地址栏中有1000条这样的Plus记录
你能帮忙吗?
我尝试过的事情:
- 不知道这个
你可以帮忙吗
提前感谢
Hey in the address column there are duplicates value
e.g Alak Jyot chs flat no 1101 Alak Jyot chs flat no 1101
--Need output as Alak Jyot chs flat no 1101.
-- There are 1000 Plus records like this in address column
Can you please help ?
What I have tried:
--Don't know about this
can you help
thanks in advance
推荐答案
用您的演示语言进行操作:
读取所有行 - 检查每一行,并查看它是否重复:
Do it in your presentation language:
Read all rows - check each row, and see if it's a duplicate:
private bool IsDoubled(string s)
{
int half = s.Length / 2;
if (s.Length % 2 != 0)
{
half++;
}
for (int i = 0, j = half; j < s.Length; i++, j++)
{
if (s[i] != s[j]) return false;
}
return true;
}
如果是,请使用Substring将其减半,并更新DB Row。
If it is, use Substring to halve it, and UPDATE the DB Row.
这篇关于如何删除重复值。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文