Jump to content

String matching: Difference between revisions

PascalABC.NET
(PascalABC.NET)
Line 3,611:
1
};</syntaxhighlight>
 
=={{header|PascalABC.NET}}==
<syntaxhighlight lang="delphi">
##
Println('abcd'.StartsWith('ab'));
Println('abcd'.EndsWith('cd'));
var abra := 'abracadabra';
Println('bra' in abra);
var ind := abra.IndexOf('bra');
var ind1 := abra.IndexOf('bra', ind + 1);
Println(ind,ind1);
abra.Matches('bra').Select(m -> m.Index).Println
</syntaxhighlight>
{{out}}
<pre>
True
True
True
1 8
1 8
</pre>
 
 
=={{header|Perl}}==
206

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.