RosettaCodeData/Task/Substring/ASIC/substring.asic

34 lines
666 B
Plaintext

REM Substring
Base$ = "abcdefghijklmnopqrstuvwxyz"
N = 12
M = 5
REM Starting from N characters in and of M length.
Sub$ = MID$(Base$, N, M)
PRINT Sub$
REM Starting from N characters in, up to the end of the string.
L = LEN(Base$)
L = L - N
L = L + 1
Sub$ = MID$(Base$, N, L)
PRINT Sub$
REM Whole string minus last character.
L = LEN(Base$)
L = L - 1
Sub$ = LEFT$(Base$, L)
PRINT Sub$
REM Starting from a known character within the string and of M length.
B = INSTR(Base$, "b")
Sub$ = MID$(Base$, B, M)
PRINT Sub$
REM Starting from a known substring within the string and of M length.
Find$ = "pq"
B = INSTR(Base$, Find$)
Sub$ = MID$(Base$, B, M)
PRINT Sub$
END