[ create a new paste ] login | about

Link: http://codepad.org/tdWlrOXu    [ raw code | output | fork ]

Perl, pasted on Aug 18:
1
2
3
4
5
6
7
8
9
10
11
12
13
$s = "Let's dance the macarena";

$word = "dance";
$ok = index($s,$word) >= 0;
print($ok ? "YES\n" : "NO\n");

$word = "car";
$ok = index($s,$word) >= 0;
print($ok ? "YES\n" : "NO\n");

$word = "duck";
$ok = index($s,$word) >= 0;
print($ok ? "YES\n" : "NO\n");


Output:
1
2
3
YES
YES
NO


Create a new paste based on this one


Comments: