Dim str As String = "SN:20013040150 MAC:84:79:73:06:9e:40 H/W:MFRP0640080330BD00" If str.Contains("SN:") And str.Contains("MAC:") And str.Contains("H/W:") Then Dim idx1 As Integer = str.IndexOf("MAC:") Dim idx2 As Integer = str.IndexOf("H/W:") msgbox(str.SubString(3, idx1-3)) msgbox(str.substring(idx1+4, idx2-idx1-5)) msgbox(str.substring(idx2+5)) End If