Mid

Returns the specified substring.

Syntax

Mid(string, nstartchar, nchar)

Parameters

Parameter

Type

Description

string

string

String parameter.

nstartchar

number

1-based index of the start character

nchar

number

Number of characters to select.

Return

Returns the substring that starts at character nstartchar and contains nchar characters.

Examples

Python

s = 'abcdefg'
sub = s[2:2+3]
# sub now is "cde"

NexScript

sub = Mid("abcdefg", 2, 3)
% sub now is "cde"