litLIB Help
Product pages :
litLIB
Quick links:
help index
forums

String - TextBetween

Syntax:
=TextBetween(TextSearched, CopyFromText, CopyUntilText, Optional OccurrenceFromText , Optional OccurrenceUntilText )

Description:
Extracts the text from TextSearched between the position where the CopyFromText and CopyUntilText can be found. Optionally you can indicate to search for the nth occurrence of these texts.

TextSearched: String to be searched
CopyFromText: Find the CopyFromText and extract all text that comes after it.
CopyUntilText: Stop extracting from TextSearched until the CopyUntilText is found.
OccurrenceFromText : Optional. If you would like to skip a few occurrences of the CopyFromText you can indicate here which occurrence should be used.
OccurrenceUntilText : Optional. If you would like to skip a few occurrences of the OccurrenceUntilText you can indicate here which occurrence should be used.

Example:

B2 = "All you can control is your mind, your thoughts you take with your mind and the actions based on those thoughts. Your mind is a fortress in which you can retreat. [Marcus Aurelius]"

=textbetween(B2,"control","mind")
Result: is your
 
=textbetween(B2,"your","take")
Result: mind, your thoughts you

=textbetween(B2,"your","take",2)

Result: thoughts you