PDA

View Full Version : Usage of the LEFT$ MID$ RIGHT$ Keywords



Michael Clease
28-05-2007, 10:37
' Usage of the LEFT$ Keyword example
' Usage of the MID$ Keyword example
' Usage of the RIGHT$ Keyword example
'
'
' Written by Abraxas

DIM MyOLDString as String value "HELLO WORLD"
DIM MyLEFTString as string
DIM MyMIDString as string
DIM MyRIGHTString as string
DIM sMsg as string

MyLEFTString = LEFT$(MyOLDString, 4)
MyMIDString = MID$(MyOLDString, 4, 2)
MyRIGHTString = RIGHT$(MyOLDString, 5)

sMsg += "Normal " & MyOLDString & $CRLF & $CRLF
sMsg += "LEFT$ " & MyLEFTString & $CRLF & $CRLF
sMsg += "MID$ " & MyMIDString & $CRLF & $CRLF
sMsg += "RIGHT$ " & MyRIGHTString & $CRLF & $CRLF

MsgBox 0, sMsg

ErosOlmi
28-05-2007, 11:45
Taken. Thanks