Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,19 @@
SUB stripComment (s$, commentMarkers$)
IF s$ = "" THEN RETURN
i = INSTR(s$, commentMarkers$)
IF i > 0 THEN
s$ = LEFT$(s$, i - 1)
s$ = LTRIM$((RTRIM$(s$))) '' removes both leading and trailing whitespace
END IF
END SUB
DIM s$(1 TO 4)
s$(1) = "apples, pears # and bananas"
s$(2) = "apples, pears ; and bananas"
s$(3) = "# this is a comment"
s$(4) = " # this is a comment with leading whitespace"
FOR i = 1 TO 4
CALL stripComment(s$(i), "#;")
PRINT s$(i), " => Length ="; LEN(s$(i))
NEXT i