is there a command that can get the third index of a character in a string? For example:
error: file.ext: line 10: invalid command [test:)]
String.IndexOf will get you the index of the first, but has overloads giving a starting point. So you can use a the result of the first IndexOf plus one as the starting point for the next. And then just accumulate indexes a sufficient number of times:
var offset = myString.IndexOf(':');
offset = myString.IndexOf(':', offset+1);
var result = myString.IndexOf(':', offset+1);
Add error handling unless you know that myString contains at least three colons.