RockGuitarist1 RockGuitarist1 - 6 months ago 36 Question

How to Remove Specific Text from Combobox Items

What I want to do is be able to remove a section of a string and use the remaining portion of it to add to a Combobox.

Dim randString As String = ""
textbox.text = "(Remove this) - Keep this"
randString = textbox.text.... ' Trim/Split the first portion off somehow?

' Result should look like " - Keep this"

I've tried Trim/Split without any luck. Could anyone point me in the right direction? Thanks.


If you just want to remove a portion of the string, you can use the Replace function:

randString = Replace(textbox.text, "(Remove this)", "")

You can put any string variable in as the second argument.