RosettaCodeData/Task/Substring/Run-BASIC/substring.basic
2023-07-01 13:44:08 -04:00

8 lines
483 B
Text

n = 2
m = 3
s$ = "abcd"
a$ = mid$(a$,n,m) ' starting from n characters in and of m length
a$ = mid$(a$,n) ' starting from n characters in, up to the end of the string
a$ = Print mid$(a$,1,(len(a$)-1)) ' whole string minus last character
a$ = mid$(a$,instr(a$,s$,1),m) ' starting from a known character within the string and of m length
a$ = mid$(a$,instr(a$,s$,1), m) ' starting from a known substring within the string and of m length.