如何删除重复值。
问题描述:
嘿,在地址栏中有重复值
例如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.