21 lines
494 B
Text
21 lines
494 B
Text
import system'routines;
|
|
import extensions;
|
|
|
|
public program()
|
|
{
|
|
var haystack := new string[]::("Zig", "Zag", "Wally", "Ronald", "Bush", "Krusty", "Charlie", "Bush", "Bozo");
|
|
|
|
new string[]::("Washington", "Bush").forEach:(needle)
|
|
{
|
|
var index := haystack.indexOfElement:needle;
|
|
|
|
if (index == -1)
|
|
{
|
|
console.printLine(needle," is not in haystack")
|
|
}
|
|
else
|
|
{
|
|
console.printLine(needle, " - ", index)
|
|
}
|
|
}
|
|
}
|