Strip out a string for comparison?

I have a string with a number that can be 1 or 2 digits and a colon, then a space and then a name string. For example:

14: John Smith

How would I strip out the number and the colon (and space after the colon), just leaving the name? I’m wanting to compare this string with another existing string.

Split or NthField on the space:

dim s as string = "14: John Smith"
dim arr() as string = split(s, " ")
dim name as string = arr(1)
// name = "John Smith"
dim s as string = "14: John Smith"
dim name as string = NthField(s, " ", 2)
  Dim S as String = "14: John Smith"
  S = Mid(S, Instr(S, ": ") + 2)

Ok, I added the lines to my CellBackgroundPaint of my listbox:

if row < me.ListCount then nam = me.cell(row,0) nam2 = Mid(nam, Instr(nam, ": ") + 2) If nam2 = ydna(primary)) then g.ForeColor = &c324F17 g.FillRect(0, 0, g.Width, g.Height) end if end if

I strip out the number and colon and then compare the string to light the appropriate listbox cell green. But i’m getting an error on the 4th line: “The keyword ‘then’ is expected after this if statements condition.” But there is a ‘then’ there already? Weird.

Take a look at the line, you’ve got too many closing parenthesis.

Duh, that’ll teach me to code late at night, I saw it right before you posted. lol