Jump to content

String matching: Difference between revisions

no edit summary
(Added PicoLisp)
No edit summary
Line 69:
TFFT -1 +1 +3
</pre>
 
=={{header|C sharp|C#}}==
{{works with|Mono|2.6}}
 
<lang csharp>
class Program
{
public static void Main (string[] args)
{
var value = "abcd".StartsWith("ab");
value = "abcd".EndsWith("zn"); //returns false
value = "abab".Contains("bb"); //returns false
value = "abab".Contains("ab"); //returns true
int loc = "abab".IndexOf("bb"); //returns -1
loc = "abab".IndexOf("ab"); //returns 0
loc = "abab".IndexOf("ab",loc+1); //returns 2
}
}
</lang>
 
 
=={{header|C++}}==
Cookies help us deliver our services. By using our services, you agree to our use of cookies.