Data update
This commit is contained in:
parent
796d366b97
commit
35bcdeebf8
504 changed files with 7045 additions and 610 deletions
23
Task/String-matching/EasyLang/string-matching.easy
Normal file
23
Task/String-matching/EasyLang/string-matching.easy
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
func starts s$ t$ .
|
||||
if substr s$ 1 len t$ = t$
|
||||
return 1
|
||||
.
|
||||
return 0
|
||||
.
|
||||
func ends s$ t$ .
|
||||
if substr s$ (len s$ - len t$ + 1) len t$ = t$
|
||||
return 1
|
||||
.
|
||||
return 0
|
||||
.
|
||||
func contains s$ t$ .
|
||||
for i to len s$ - len t$ + 1
|
||||
if substr s$ i len t$ = t$
|
||||
return 1
|
||||
.
|
||||
.
|
||||
return 0
|
||||
.
|
||||
print starts "hello world" "he"
|
||||
print ends "hello world" "rld"
|
||||
print contains "hello world" "wo"
|
||||
Loading…
Add table
Add a link
Reference in a new issue