【发布时间】:2014-10-07 15:22:42
【问题描述】:
我的 listbox1 包括:
ListBox1.Items.Add("https://myweb.com/#questionsquestions/4444444/x/testxx")
ListBox1.Items.Add("https://translate.google.com/#questions/HAHAHAHA/testxx")
ListBox1.Items.Add("https://translate.google.com/#questions/HAHAHAHA/testxx")
ListBox1.Items.Add("http://stackexchange.com/")
ListBox1.Items.Add("http://stackoverflow.com/questions/23304084/how-to-remove-text-from-a-list-box")
ListBox1.Items.Add("http://stackoverflow.com/users/2227126/abdullah-kassha")
ListBox1.Items.Add("http://stackoverflow.com/questions/7860214/vb-net-split-string")
ListBox1.Items.Add("#")
ListBox1.Items.Add("http://stackoverflow.com/questions/25808080/categorize-listbox-items-by-color")
ListBox1.Items.Add("")
ListBox1.Items.Add("http://stackoverflow.com/questions/7073532/textbox-text-to-listbox-items-vb-net")
ListBox1.Items.Add("questiooonsquestions/ID_3324244/v")
ListBox1.Items.Add("cccccquestions/ID_3324244/RNA")
ListBox1.Items.Add("cccccquestions/ID_9999999/RNA")
我想拆分或获取"questions/" 和"/" 之间的文本,不包含任何空白或重复项
示例图片:
【问题讨论】:
-
到目前为止有什么尝试吗?并可能阅读split
-
@jbutler483 当然是的,我试过了,我已经将字符串列表拆分为 ComboBox,但字符串不包含空或重复的项目,但不能在列表框中执行相同的操作,这样 /ˢᵒʳʳʸ ᶠᵒʳ ᵐʸ ᵇᵃᵈ ᵉᶰᵍˡᶤˢʰ ᶤᵗˢ ᶰᵒᵗ ᵐʸ ᵐᵒᵗʰᵉʳ ˡᵃᶰᵍᵘᵃᵍᵉ
-
它们是如何被添加到列表框中的?每当输入下一个值时,您就不能对此进行测试吗? (在 ListBox 中使用 foreach 元素?)并检查它是否已经包含该值?如果值不是“”?
标签: .net vb.net list split listbox