14 lines
765 B
Plaintext
14 lines
765 B
Plaintext
10 ' SAVE"BINSTR", A
|
|
20 ' This program does string manipulation
|
|
30 A$ = "One value" ' String creation
|
|
40 A$ = "": PRINT FRE("") ' String destruction
|
|
50 A$ = "One value": B$ = "Other value" ' String assignment
|
|
60 PRINT A$ = B$; A$ <> B$; A$ < B$; A$ > B$; A$ <= B$; A$ >= B$' String comparison
|
|
70 B$ = A$ ' String cloning and copying
|
|
80 PRINT A$ = ""' Check if a string is empty
|
|
90 A$ = A$ + "!": PRINT A$' Append a byte to a string
|
|
100 PRINT MID$(A$, 5, 5); MID$(A$, 4, 1); LEFT$(A$, 3); RIGHT$(A$, 1)' Extract a substring from a string
|
|
110 B$ = "e": WHILE INSTR(A$, B$) > 0: MID$(A$, INSTR(A$, B$), 1) = "x": WEND: PRINT A$' Replace every ocurrence of a byte in a string with another string
|
|
120 C$ = A$ + " and " + STRING$(10, "-"): PRINT C$' Join strings
|
|
130 END
|