Remove all characters after a colon in a string

I have a string eg "43242: Hi there". I want to get rid of all the characters after and including the semi colon. How do I do this in vb.net?
sebastizAsked:
Who is Participating?
 
dampseyConnect With a Mentor Commented:
sorry, my first post is not vb :(
Here the correct version:

dim test as string = "43242: Hi tthere"
dim indexOfColon as integer = test.indexOf(":")
dim firstBlock as string = test.substring(0,indexOfColon)
0
 
dampseyCommented:
string test = "43242: HiTehere"
int indexOfColon = test.indexof(":")
string firstBlock = test.substring(0, indexOfColon)
0
 
TimCotteeCommented:
Another option is:

Dim Result As String = "43242: Hi There".Split(":")(0)
0
All Courses

From novice to tech pro — start learning today.