Requires: GfaWinx.lg32
Determines whether a sting begins or ends with a certain character.
bool = EndsWith(source$, strcmp$ [, ignorecase? = False])
bool = StartsWith(source$, strcmp$ [, ignorecase? = False])
source$, strcmp$ | : string |
ignorecase? | : boolean |
These functions can be used to compare the start and end characters of a string with either a specific string or one stored in another variable. The third optional parameter determines whether case should be ignored in the comparison; this defaults to FALSE.
Local a$ = "GFABasic with gfawinx", b$ = "nx"
Debug StartsWith(a$, "g") // False - case sensitive
Debug StartsWith(a$, "g", True) // True - ignore case
Debug EndsWith(a$, b$) // True - case sensitive
Debug EndsWith(a$, b$, True) // True - ignore case
Debug.Show
FindFirstOf, FindLastOf, InStr, Left$, Mid$, Right$, RInStr.
{Created by James Gaite; Last updated: 18/12/2022 by James Gaite}