String matching: Difference between revisions

Content added Content deleted
m (→‎{{header|Icon}} and {{header|Unicon}}: Regularize non-standard header markup)
No edit summary
Line 771: Line 771:


=={{header|Arturo}}==
=={{header|Arturo}}==
<lang rebol>print prefix? "abcd" "ab"
print prefix? "abcd" "cd"
print suffix? "abcd" "ab"
print suffix? "abcd" "cd"


<lang arturo>print "'abcd' starts with 'ab' = " + [startsWith "abcd" "ab"]
print contains? "abcd" "ab"
print contains? "abcd" "xy"


print "'abcd' contains 'bc' = " + [contains "abcd" "bc"]
print in? "ab" "abcd"
print "'bc' found in 'abcd' at location = " + [index "abcd" "bc"]
print in? "xy" "abcd"


print "'abcd' ends with 'zn' = " + [endsWith "abcd" "zn"]</lang>
print index "abcd" "bc"
print index "abcd" "xy"</lang>


{{out}}
{{out}}


<pre>'abcd' starts with 'ab' = true
<pre>true
false
'abcd' contains 'bc' = true
false
'bc' found in 'abcd' at location = 1
true
'abcd' ends with 'zn' = false</pre>
true
false
true
false
1
null</pre>


=={{header|AutoHotkey}}==
=={{header|AutoHotkey}}==