RosettaCodeData/Task/String-matching/Zkl/string-matching-2.zkl

4 lines
158 B
Text
Raw Permalink Normal View History

2017-09-23 10:01:46 +02:00
fcn f(text,p){ if(Void!=(n:=text.find(p)))println("Contained @",n) else println("Nope") }
f("foobar","ob") //--> Contained @2
f("foobar","food") //--> Nope