String matching: Difference between revisions

Content added Content deleted
Line 516: Line 516:
=={{header|Arturo}}==
=={{header|Arturo}}==


<lang arturo>print "'abcd' starts with 'ab' = " + $(startsWith "abcd" "ab")
<lang arturo>print "'abcd' starts with 'ab' = " + [startsWith "abcd" "ab"]


print "'abcd' contains 'bc' = " + $(contains "abcd" "bc")
print "'abcd' contains 'bc' = " + [contains "abcd" "bc"]
print "'bc' found in 'abcd' at location = " + $(find "abcd" "bc")
print "'bc' found in 'abcd' at location = " + [index "abcd" "bc"]


print "'abcd' ends with 'zn' = " + $(endsWith "abcd" "zn")</lang>
print "'abcd' ends with 'zn' = " + [endsWith "abcd" "zn"]</lang>


{{out}}
{{out}}