Dim data As String = "M123456789^M123^C123^M1234^"
Dim mIndex = data.IndexOf("M")
Dim caretIndex = data.IndexOf("^", mIndex + 1)
Console.WriteLine(data.Substring(mIndex, caretIndex - mIndex + 1))
Console.WriteLine(data.Substring(mIndex))
mIndex = data.IndexOf("M", caretIndex)
caretIndex = data.IndexOf("^", mIndex + 1)