LEFT$ returns the leftmost substring of a string.
Syntax:SubStr = LEFT$(MainStr AS STRING, Length AS INTEGER) Return Value:
Parameters: |
CLS DIM Substr AS STRING DIM MainStr AS STRING DIM StartPos AS INTEGER DIM Length AS INTEGER MainStr = "OneTwoThree" Length = 3 Substr = LEFT$(MainStr, Length) PRINT Substr StartPos = 4 Substr = MID$(MainStr, StartPos, Length) PRINT Substr Length = 5 Substr = RIGHT$(MainStr, Length) PRINT Substr PAUSE END
One Two Three Press any key to continue . . .
LEFTSTR searching from the left, returns TRUE if Match is a proper substring of MainStr or else FALSE if Match is not found.
Syntax:RetVal = LEFTSTR(MainStr AS STRING, _ Match AS STRING _ [,CaseSensitivity AS INTEGER]) Return Value:
Parameters:
|
DIM RetVal% RetVal% = LEFTSTR("abcdefg", "abcd") PRINT RetVal%
1