Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
19
Task/Substring/Applesoft-BASIC/substring.basic
Normal file
19
Task/Substring/Applesoft-BASIC/substring.basic
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
0 READ N, M, S$ : L = LEN(S$) : GOSUB 1 : END : DATA 5,11,THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG,J,FOX
|
||||
|
||||
REM starting from n characters in and of m length;
|
||||
1 PRINT MID$(S$,N,M)
|
||||
|
||||
REM starting from n characters in, up to the end of the string;
|
||||
2 PRINT RIGHT$(S$,L-N+1)
|
||||
|
||||
REM whole string minus the last character;
|
||||
3 PRINT LEFT$(S$,L-1)
|
||||
|
||||
REM starting from a known character within the string and of m length;
|
||||
4 READ F$ :GOSUB 6
|
||||
|
||||
REM starting from a known substring within the string and of m length.
|
||||
5 READ F$
|
||||
|
||||
6 FOR I = 1 TO L : IF MID$(S$,I,LEN(F$)) = F$ THEN PRINT MID$(S$,I,M) : RETURN
|
||||
7 NEXT : RETURN
|
||||
Loading…
Add table
Add a link
Reference in a new issue