Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
20
Task/String-matching/Frink/string-matching.frink
Normal file
20
Task/String-matching/Frink/string-matching.frink
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
s1 = "string"
|
||||
s2 = "str"
|
||||
s3 = "ing"
|
||||
s4 = "xyz"
|
||||
|
||||
println["$s1 starts with $s2: " + startsWith[s1, s2]]
|
||||
println["$s1 starts with $s4: " + startsWith[s1, s4]]
|
||||
println["$s1 ends with $s3: " + endsWith[s1, s3]]
|
||||
println["$s1 ends with $s4: " + endsWith[s1, s4]]
|
||||
position[s1, s2]
|
||||
position[s1, s4]
|
||||
|
||||
position[s1, s2] :=
|
||||
{
|
||||
pos = indexOf[s1,s2]
|
||||
if pos == -1
|
||||
println["$s1 does not contain $s2"]
|
||||
else
|
||||
println["$s1 contains $s2 at position $pos"]
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue