String matching: Difference between revisions

Content added Content deleted
m (→‎{{header|Julia}}: manners for v0.4)
Line 1,539: Line 1,539:


=={{header|Julia}}==
=={{header|Julia}}==
<lang julia>begins_with("abcd","ab") #returns true
<lang julia>startswith("abcd","ab") #returns true
search("abcd","ab") #returns 1:2, indices range where string was found
search("abcd","ab") #returns 1:2, indices range where string was found
ends_with("abcd","zn") #returns false
endswith("abcd","zn") #returns false
ismatch(r"ab","abcd") #returns true where 1st arg is regex string
ismatch(r"ab","abcd") #returns true where 1st arg is regex string
julia>for r in each_match(r"ab","abab")
julia>for r in each_match(r"ab","abab")