Hello I’m a bit stuck on a substring method that has to extract dates from a text document.
So there are two different types of dates that are on the document such as the expiry date and signed date.
I have four variables and they are as follows…
strTextFile = whole document
intStartIndex = strTextFile.IndexOf(“DATE”) +4
intFinishIndex = strTextFile.IndexOf(“DAYTIME”) -0
intLength = inFinishIndex - intStartIndex
strSignedDate = strTextFile.Substring(intStartIndex, intLength)
For example: DATE 02/05/2019 DAYTIME
The problem I’m having is that the starting index is starting at the top of the document next to the expiry date, which is then displaying the whole document in the string. Where’s I would like it to be starting at the bottom next to the signed date.
Is there a way to make it so that the substring method will start at the 2nd occurrence of the word “DATE”?
Many Thanks