gpt4 book ai didi

c# - 如何删除数组中的空元素?

转载 作者:行者123 更新时间:2023-11-30 13:21:53 26 4
gpt4 key购买 nike

<分区>

我有一个电子邮件地址数组,但是一个空字符串被注入(inject)到数组的末尾。如何删除数组中的这个元素?

for(int i = 0; i < allToAddresses.Length; i++)
{
if(allToAddresses[i] == " ") // find where empty element is
{ //Here i am trying to delete that empty element. does not work
allToAddresses[i].Split("".ToCharArray(),StringSplitOptions.RemoveEmptyEntries);
}
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com