I am trying to store in a variable, a word which is between two other words. For example between "Me" and "apples":
Code: Select all
string := "Me eat apples hungry yes" ; i would like to store the word "eat" in a variable
The thing is that the space between words may vary, but the two words that would stay the same are "Me" and "apples", and i want to get what ever word between them.
I know how to get the second word of an array this way
Code: Select all
TestString := "This is a test."
word_array := StrSplit(TestString, A_Space)
MsgBox % "The 2nd word is " word_array[2]
But if there is two words between me and apples, how do i get the stuff between