Skip to content

Latest commit

 

History

History
76 lines (64 loc) · 2.4 KB

MID$.org

File metadata and controls

76 lines (64 loc) · 2.4 KB

Top | Up (String) | < Previous (PAGE NAME) | Next (PAGE NAME) >

MID$

Extract characters from a string, starting on the specified pos% of the string.

Syntax

MID$ string$, pos%, length% OUT substring$
ParameterDescription
string$A string.
pos%Position on string$ to start extracting characters.
length%The number of characters to extract, starting from pos%. Can’t be less than 0.
OutputDescription
substring$The extracted characters from string$

If pos% is bigger than the length of string$, the function does not trigger an error. Instead, returns nothing.

Examples

PRINT MID$("TEST",1,2) ' ES
PRINT MID$("12345",3,1) ' 4

Possible Errors

ErrorCause
Out of rangelength% is less than 0, or pos% is less than 0.

See Also:


Top | Up (String) | < Previous (PAGE NAME) | Next (PAGE NAME) >