6.8.2.16 Strmid Function

Syntax

strmid (expression, expression2, expression3)

Description

The strmid function returns a substring of expression1 starting at expression2 for expression3 characters. A starting position of 1 denotes the first character of expression1.

If expression1 is less than 1, the starting position is 1. If expression1 is greater than the number of characters in expression1, the starting position is one past the last character of expression1. If the starting position plus the length (expression3) extends past the end of the string, the length is adjusted to keep the ending position within the string.

Examples

strmid ("Hello World", 4, 5) returns "lo Wo"

strmid ("Hello World", 0, 5) returns "Hello"

strmid ("Hello World", 7, 20) returns "World"

strmid ("Hello World", 20, 5) returns ""