Solved String to get text between two words

Status
Not open for further replies.
Can we create a string in the calculate stage that can get the text between two words?
For example: "Hi its me"
So the output should be "its".
 

RDawson9

Geek
Staff member
Hi @amanbareilly

It depends what you know about the string. For example, do you know what the first and third words will be? Do you know only the first word or only the third? You’ll need to use a mixture of InStr, Replace and Trim.

If neither, then you could look for the space between the words and trim everything around it.

Rob
 

RDawson9

Geek
Staff member
For instance, if you know the 1st and 3rd words then you could use:

Replace([String], "Hi", "")

which will replace "Hi" with nothing. You could then use

Replace([String], "me", "")

to remove the word "me". Then

Trim([String])

to remove any further whitespace and leave you with the second word.
 
Status
Not open for further replies.
Top