Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
35
Task/String-matching/OxygenBasic/string-matching.basic
Normal file
35
Task/String-matching/OxygenBasic/string-matching.basic
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
string s="sdfkjhgsdfkdfgkbopefioqwurti487sdfkrglkjfs9wrtgjglsdfkdkjcnmmb.,msfjflkjsdfk"
|
||||
|
||||
string f="sdfk"
|
||||
|
||||
string cr=chr(13)+chr(10),tab=chr(9)
|
||||
|
||||
string pr="FIND STRING LOCATIONS" cr cr
|
||||
|
||||
sys a=0, b=1, count=0, ls=len(s), lf=len(f)
|
||||
|
||||
do
|
||||
a=instr b,s,f
|
||||
if a=0 then exit do
|
||||
count++
|
||||
if a=1 then pr+="Begins with keyword" cr
|
||||
pr+=count tab a cr
|
||||
if a=ls-lf+1 then pr+="Ends with keyword at " a cr
|
||||
b=a+1
|
||||
end do
|
||||
|
||||
pr+=cr "Total matches: " count cr
|
||||
|
||||
print pr
|
||||
|
||||
'FIND STRING LOCATIONS
|
||||
'
|
||||
'Begins with keyword
|
||||
'1 1
|
||||
'2 8
|
||||
'3 32
|
||||
'4 51
|
||||
'5 73
|
||||
'Ends with keyword at 73
|
||||
'
|
||||
'Total matches: 5
|
||||
Loading…
Add table
Add a link
Reference in a new issue