Anonymous user
String matching: Difference between revisions
no edit summary
(Racket version) |
No edit summary |
||
Line 792:
In fact, it happens 2 times within 'tacoloco', at indexes 2, 6.
3: Does 'tacoloco' end with 'co'? Yes.</pre>
=={{header|Julia}}==
<lang julia>begins_with("abcd","ab") #returns true
search("abcd","ab") #returns 1:2, indices range where string was found
ends_with("abcd","zn") #returns false
ismatch(r"ab","abcd") #returns true where 1st arg is regex string
julia>for r in each_match(r"ab","abab")
println(r.offset)
end
1
3</lang>
=={{header|K}}==
|