MID

Top  Previous  Next

Action

The MID function returns part of a string (a sub string).

The MID statement replaces part of a string variable with another string.

 

 

Syntax

var = MID(var1 ,st [, l] )

MID(var ,st [, l] ) = var1

 

 

Remarks

Var

The string that is assigned.

Var1

The source string.

St

The starting position.

L

The number of characters to get/set.

Operations on strings require that all strings are of the same type(internal or external)

 

 

See also

LEFT , RIGHT

 

 

Example

Dim S As Xram String * 15 , Z As Xram String * 15

S = "ABCDEFG"

Z = Mid(s , 2 , 3)

Print Z                                   'BCD

Z = "12345"

Mid(s , 2 , 2) = Z

Print S                                   'A12DEFG

End