Returns any substring from the middle of a string. The middle is found by scanning the string from left to right, and parameters determine where the middle begins and ends.
@Middle( string ; offset ; numberchars ) @Middle( string ; offset ; endstring ) @Middle( string ; startString ; endstring ) @Middle( string ; startString ; numberchars )
string
Text or text list. Any string.
offset
Number. A character position in string that indicates where you want the middle to begin, always counting from left to right. The middle begins one character after the offset.
startString
Text. A substring of string that indicates where you want the middle to begin, always counting from left to right. The middle begins one character after the end of startString.
numberchars
Number. The number of characters that you want in the middle. If numberchars is negative, the middle starts at offset or startString and continues from right to left. If numberchars is positive, the middle starts one character past the offset or startString and continues from left to right.
endstring
Text. A substring of string that indicates the end of the middle. @Middle returns all the characters between offset and endstring, or between startString and endstring.
middle
Text or text list. The substring from the middle of string, which begins at the offset or startString you specify and ends at the endstring you specify, or after the numberchars have been reached.
If the first parameter is a list, the function operates on each element of the list, and the return value is a list with the same number of elements.
@Middle("North Carolina";4;3)
@Middle("North Carolina";4;-3)
@Middle("North Carolina";" ";3)
@Middle("North Carolina";"th";-2)
@Middle("This is the text"; 4; "text")
@Middle("This is the text"; " is"; "text")
@Middle("Hello world" : "This is the time"; 0; " ")
Mid function of LotusScript® language