Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue