MID$/WMID$

Top  Previous  Next

Syntax

STRING = MID$(str as STRING,start as INT,OPT count=-1 as INT)

WSTRING = WMID$(str as WSTRING,start as INT,OPT count=-1 as INT)

Description

Extracts zero or more characters from any position in the specified input string.

Parameters

str - The input string to extract characters from/

start - Ones based starting position of the extraction.

count - Optional. Number of characters to extract. If omitted then all characters from the starting position to the end of the string are included in the extracted substring.

Return value

A copy of the extracted substring.

Remarks

See Also: LEFT$, RIGHT$

Example usage

A$ = "This is a test"
IF MID$(A$, 6, 2) = "is" THEN PRINT "cool"
PRINT MID$(A$, 9)