SourcePoint Intel Help

Table of Contents

mid

Extract a number of characters from the middle of a string.

Syntax

[result =] mid(string-expr, n, m)

Where:

result

specifies an nstring variable to which the function return value is assigned. If result is not specified, the return value is displayed on the next line of the screen.

string-expr

specifies an nstring variable or string constant.

n

specifies the 0-based index of the first character to extract.

m

specifies the number of characters to extract.

Discussion

The mid function returns a substring from the middle of a string. ย If the number of characters to extract exceeds the number of characters in the string, then the command behaves like the right command.

Example

Command input:

define nstring month = "January"
define nstring temp = mid(month, 3, 3)
temp

Result:

"uar"

Related Topics: