Equinox Online Help - Language Reference - A to Z
BetweenStr [Statement] |
|
---|---|
Applies to | |
Syntax | (TargetString, BeforeString, AfterString [, IgnoreCaseExpression]) = ReplacementExpression |
Action | [Statement] Replaces the substring of TargetString between BeforeString and AfterString with ReplacementExpression. |
Scope | Usable anywhere |
Notes | This function searches for BeforeString and AfterString in TargetString, and if both are found returns all the characters in TargetString between the two. If BeforeString or AfterString is not found, it returns a zero length string. If BeforeString is zero length, all of TargetString up to AfterString is returned. If AfterString is zero length, all of TargetString after BeforeString is returned IgnoreCaseExpression can have any of the following values:
To specify more than one attribute add these numbers together. |
Category | String handling |
See Also | AfterStr_Function, AfterStr_Statement, BeforeStr_Statement, BeginsWith, BeforeStr_Function, BetweenStr_Function |
Example | The following example prints the string "dear": Print BetweenStr("Hello dear John", "Hello ", " John") This example replaces everything between the phrases "top secret" and "end top secret" with a notice. If "end top secret" is not found, the remainder of the document is replaced. If "top secret" is not found, no changes are made. BeforeStr(text, "top secret", "end top secret", 1) = " TEXT REMOVED" These examples show how the new values for ignore case expression can be used. | Prints "has gone" |