RosettaCodeData/Task/String-matching/FBSL/string-matching.fbsl
2023-07-01 13:44:08 -04:00

15 lines
492 B
Text

#APPTYPE CONSOLE
DIM s = "roko, mat jane do"
IF LEFT(s, 4) = "roko" THEN PRINT STRENC(s), " starts with ", STRENC("roko")
IF INSTR(s, "mat") THEN PRINT STRENC(s), " contains ", STRENC("mat"), " at ", INSTR
IF RIGHT(s, 2) = "do" THEN PRINT STRENC(s), " ends with ", STRENC("do")
PRINT STRENC(s), " contains ", STRENC("o"), " at the following locations:", InstrEx(s, "o")
PAUSE
SUB InstrEx(mane, match)
INSTR = 0
WHILE INSTR(mane, match, INSTR + 1): PRINT " ", INSTR;: WEND
END SUB