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:)]
Please see this answer on a similar question:
https://stackoverflow.com/a/46460083/7673306
It provides a method for you to find the index of nth occurrence of a specific character within a designated string.
In your specific case it would be implemented like so:
int index = IndexOfNthCharacter("error: file.ext: line 10: invalid command [test:)]", 3, ':');