Anonymous user
String matching: Difference between revisions
Changed formatting. Added "in" test. Moved "find" at the end.
m (→{{header|Phix}}: added syntax colouring the hard way, phix/basics) |
(Changed formatting. Added "in" test. Moved "find" at the end.) |
||
Line 2,817:
<lang nim>import strutils
if s.startsWith(
if s.endsWith(
echo "Contains “ brown ”."
if "quick" in s:
echo('"' & " brown " & '"' & " is located at position: " & $pos)</lang>▼
echo "Contains “quick”." # Alternate form for "contains".
let pos = find(s, " brown ") # -1 if not found.
if pos >= 0:
{{out}}
<pre>Starts with
Contains “quick”.
=={{header|Objeck}}==
|