Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
26
Task/Substring/OPL/substring.opl
Normal file
26
Task/Substring/OPL/substring.opl
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
REM https://github.com/Eva-Broccoli/OPL-Rosetta-Code/blob/main/Substrng.opl
|
||||
PROC main:
|
||||
LOCAL string$(68),i%
|
||||
string$="'Twas brillig, and the slithy toves did gyre and gimble in the wabe."
|
||||
i%=1
|
||||
PRINT "Original string:"
|
||||
PRINT " "+string$
|
||||
PRINT :PRINT "Starting from 7th character and 23 length:"
|
||||
PRINT " "+MID$(string$,7,23)
|
||||
PRINT :PRINT "Starting from 50th character until end of string:"
|
||||
PRINT " "+RIGHT$(string$,1+LEN(strintg$)-50)
|
||||
PRINT :PRINT "Whole string minus the last character:"
|
||||
PRINT LEFT$(string$,LEN(string$)-1)
|
||||
PRINT :PRINT "Starting from character ""h"" and 9 length:"
|
||||
WHILE MID$(string$,i%,1)<>"h"
|
||||
i%=i%+1
|
||||
ENDWH
|
||||
PRINT " "+MID$(string$,i%,9)
|
||||
PRINT :PRINT "Starting from substring ""the"" and 16 length:"
|
||||
i%=1
|
||||
WHILE MID$(string$,i%,3)<>"the"
|
||||
i%=i%+1
|
||||
ENDWH
|
||||
PRINT " "+MID$(string$,i%,16)
|
||||
GET
|
||||
ENDP
|
||||
Loading…
Add table
Add a link
Reference in a new issue